Right now on my current website, I have it going through the pictures in the order of the array, but I would like it so whenever the user refreshes the website, the slideshow randomly shuffles the pictures in a different order.
Any help is appreciated! =]Code:<script type="text/javascript"> var imgs = [ 'images/slideshow/001.jpg', 'images/slideshow/002.jpg', 'images/slideshow/003.jpg', 'images/slideshow/004.jpg', 'images/slideshow/005.jpg', 'images/slideshow/006.jpg']; var cnt = imgs.length; $(function() { setInterval(Slider, 3000); }); function Slider() { $('#imageSlide').fadeOut("slow", function() { // the source of the problem $(this).attr('src', imgs[Math.floor (Math.random( ) * imgs.length) % cnt]).fadeIn("slow"); }); } </script>




Reply With Quote