I'm using the Simple jQuery Slideshow Script by Jon Raasch (http://jonraasch.com/blog/a-simple-jquery-slideshow) and was wondering how I could enable the user to click on the image to go to the next image while also keeping the autoplay mode of the slideshow on. First time in trying to built a website, so I have very basic knowledge in source coding/ css/jquery.
Would I have to modify both the js file and the source coding too? And how would I modify it? If anyone can help it'll be much appreciated.
Thanks!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html
xmlns="http://www.w3.org/1999/xhtml">
csutoras+liando
/*** Simple jQuery Slideshow Script Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc. Please link out to me if you like it :) ***/ function slideSwitch() { var $active = $('#slideshow DIV.active');$(function() { setInterval( "slideSwitch()", 5000 ); });if ( $active.length == 0 ) $active = $('#slideshow DIV:last'); // use this to pull the divs in the order they appear in the markup var $next = $active.next().length ? $active.next() : $('#slideshow DIV:first'); // uncomment below to pull the divs randomly // var $sibs = $active.siblings(); // var rndNum = Math.floor(Math.random() * $sibs.length ); // var $next = $( $sibs[ rndNum ] ); $active.addClass('last-active'); $next.css({opacity: 0.0}) .addClass('active') .animate({opacity: 1.0}, 1000, function() { $active.removeClass('active last-active'); }); }
/* set the width and height to match your images **/
slideshow { position:relative; height:350px; width: 500px; margin: 0 auto; }
slideshow DIV { position:absolute; top:0; left:0; z-index:8; opacity:0.0; height: 400px; background-color: #FFF; min-width:
100%; filter: alpha(opacity=0); }
slideshow DIV.active {
z-index:10; opacity:1.0; filter: alpha(opacity=100); }
slideshow DIV.last-active {
z-index:9; }
slideshow DIV IMG { height: 350px; display: block; border: 0; margin-bottom: 10px; width: 500px; }
Test
info
Caption for image 1 </div> <div> <img src="../../Images/images/photo (9).jpg" alt="Slideshow Image 2" /></a> Caption for image 2 </div> <div> <img src="../../Images/images/photo (8).jpg" alt="Slideshow Image 3" /></a> Caption for image 3 </div> <div> <img src="../../Images/images/photo (7).jpg" alt="Slideshow Image 4" /></a> Caption for image 4 </div> </div>
ABOUT
enter code here