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
You may want to look into the stop
or pause
commands: http://jquery.malsup.com/cycle/options.html
i.e.
$('#adverts').cycle('stop')