Sunday, 15 January 2012

jquery - I need two simultaneous events to happen when user clicks link -



jquery - I need two simultaneous events to happen when user clicks link -

when utilize clicks on slideshow's thumbnail (which way downwards page) want main slideshow image alter , page scroll top (where actual main image slideshow happening).

below 2 script have working individually - need them both work simultaneously. hope can help.

thanks

<script type="text/javascript"> $(function() { $('a.thumnbnail').bind('click',function(event){ var $anchor = $(this); $('html, body').stop().animate({ scrolltop: $($anchor.attr('href')).offset().top }, 1500,'easeinoutexpo'); event.preventdefault(); }); }); </script> <script type="text/javascript"> $(document).ready(function() { $('.slideshow').slideshow({ interval: 10 }); }); </script>

no need phone call in 2 different doc ready:

$(function() { //<---all in plenty $('a.thumnbnail').bind('click',function(event){ var $anchor = $(this); $('html, body').stop().animate({ scrolltop: $($anchor.attr('href')).offset().top }, 1500,'easeinoutexpo'); event.preventdefault(); },function(){ // <---------------make in callback function here $('.slideshow').show().slideshow({ // <----display:none show here interval: 10 }); }); });

jquery events slideshow simultaneous

No comments:

Post a Comment