You need to use the setInterval method
<script type="text/javascript"> $(window).load(function(){ setInterval( function(){ $.galleryUtility.slideLeft() ; }, 5000); }); </script>
Update
In your specific case, you should add it immediately after the gallery is initialized.
<script language="javascript" type="text/javascript"> $(function() { $('div.gallery img').slidingGallery(); </script>
Update 2
To start the self-timer stop, you need to clear the interval, and for this you need a reference to the return value from the setInterval call.
<script type="text/javascript"> var autoSlideInterval; function start_autoslide(){ autoSlideInterval = setInterval( function(){ $.galleryUtility.slideLeft() ; }, 5000); } function stop_autoslide(){ clearInterval( autoSlideInterval ); } $(function() { $('div.gallery img').slidingGallery(); start_autoslide(); }); </script>
now when you want to start the auto slide, you call start_autoslide(); , and when you need to stop it, you call stop_autoslide();
Gabriele petrioli
source share