jquery - Keep sliding when click to other page -
i've made total background slider, when click on menu-item slider starts on , over. possible if click on menu-item (to page) slider keeps sliding?
here code of slider:
function slideswitch() { var $active = $('#slideshow img.active'); if ( $active.length == 0 ) $active = $('#slideshow img:last'); var $next = $active.next().length ? $active.next() : $('#slideshow img:first'); $active.addclass('last-active'); $next.css({opacity: 0.0}) .addclass('active') .animate({opacity: 1.0}, 1500, function() { $active.removeclass('active last-active'); }); } $(function() { setinterval("slideswitch()", 10000); }); <div id="nav"> <ul> <li> <a href="">rm</a> </li> <div class="diagonal"></div> <li> <a href="">offerte</a> </li> <div class="diagonal"></div> <li> <a href="">contact</a> </li> </ul> </div> <div id="slideshow"> <img src="img/route 163.jpg" alt="slideshow image 1" class="active"> <img src="img/spring.jpg" alt="slideshow image 2"> <img src="img/road america.jpg" alt="slideshow image 3"> <img src="img/kopenhagen.jpg" alt="slideshow image 4"> </div>
jquery slider
No comments:
Post a Comment