jquery cycle stop cycle when clicked on link

I have a jquery cycle with three banners and 3 links for the banners.

<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;
    });

});

currently when you click on the link it goes to the correct banner. However, i want it to stop cycling and only change then when the user clicks on the other banner, Or increase the speed to change every 3 seconds to 10 after a click occurs?

Rgds Uzi

Answers


You may want to look into the stop or pause commands: http://jquery.malsup.com/cycle/options.html

i.e.

$('#adverts').cycle('stop')

Need Your Help

How can I configure WCF to use x509 certificates over the internet?

wcf x509

I need to use an x509 certificate to get secure message level authentication from a rich client via the internet to a secure WCF Web Service.

What is the most effective method to change color for multiple similar elements in LESS?

html css less

I have a collection of li, each with different background colors like these:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.