2012-08-22 2 views
0

У меня есть цикл jquery с тремя баннерами и 3 ссылками для баннеров.цикл остановки цикла jquery при нажатии на ссылку

<div id="adverts" style="position: relative; width: 960px; height: 246px; "> 
    <img class="im" src="/uploads/ssp/album_2/image_59.jpg" alt="open" data-id="http://co.uk/content/2/207/eis-fund-3.html" height="246" width="960" style="position: absolute; top: 0px; left: 0px; display: block; z-index: 4; opacity: 1; width: 960px; height: 246px; ">  
    <img class="im" src="/uploads/ssp/album_2/image_60.jpg" alt="extended" data-id="" height="246" width="960" style="position: absolute; top: 0px; left: 0px; display: none; z-index: 3; opacity: 0; width: 960px; height: 246px; "> 
    <img class="im" src="/uploads/ssp/album_2/image_61.jpg" alt="Welcome" data-id="" height="246" width="960" style="position: absolute; top: 0px; left: 0px; display: none; z-index: 3; opacity: 0; width: 960px; height: 246px; "> 
</div> 

<ul id="nav"> 
<li class=""><a href="#">open</a></li> 
<li class=""><a href="#">extended</a></li> 
<li class="activeSlide"><a href="#">Welcome</a></li></ul> 

$(document).ready(function() { 

    $('#adverts').cycle({ 
     fx: 'fade', 
     pager: '#nav', 
     speed: 300, 
     // callback fn that creates a thumbnail to use as pager anchor 
     pagerAnchorBuilder: function (idx, slide) { 
      return '<li><a href="#">' + slide.alt + '</a></li>'; 
     } 
    }); 

    $(".im").click(function() { 
     var url = $(this).attr('data-id'); 
     window.location = url; 
    }); 

}); 

В настоящее время, когда вы нажимаете на ссылку, она идет на правильный баннер. Тем не менее, я хочу, чтобы он остановил цикл и только изменил тогда, когда пользователь нажмет на другой баннер, или увеличит скорость, чтобы изменить каждые 3 секунды до 10 после щелчка?

Rgds Узи

ответ

Смежные вопросы