0

我有一个带有三个横幅和三个横幅链接的 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乌兹

4

1 回答 1

0

您可能需要查看stoporpause命令:http: //jquery.malsup.com/cycle/options.html

IE

$('#adverts').cycle('stop')
于 2012-08-22T14:47:53.210 回答