Revision: 29516
Updated Code
at July 31, 2010 03:41 by Jamie
Updated Code
var loopingInterval; var mySlideDeck = jQuery('.slidedeck').slidedeck(); mySlideDeck.vertical(); var interval = 1000; var firstDelay = 3000; // initialize an autoplay switch var autoPlay = false; var autoPlayLoop = true; function autoPlayAdvanceLoop(){ if(autoPlay){ // Check to see if the current slide is the last slide if(mySlideDeck.current == mySlideDeck.slides.length && autoPlayLoop == true){ // This is the last slide, go to the first slide mySlideDeck.goTo(1); } else { // This is not the last slide, go to the next slide mySlideDeck.next(); } } } // sets an initial delay setTimeout(function(){ loopingInterval = setInterval(autoPlayAdvanceLoop,interval); // Run the autoPlayAdvanceLoop() function every interval milliseconds }, firstDelay - interval) autoPlay = true; // Stop autoPlay if the deck is clicked. jQuery('.slidedeck').click(function(){ autoPlay = false; clearInterval(loopingInterval); });
Revision: 29515
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at July 31, 2010 03:38 by Jamie
Initial Code
var loopingInterval; var mySlideDeck = jQuery('.slidedeck').slidedeck(); mySlideDeck.vertical(); var interval = 1000; var firstDelay = 3000; // initialize an autoplay switch var autoPlay = false; var autoPlayLoop = true; function autoPlayAdvanceLoop(){ if(autoPlay){ // Check to see if the current slide is the last slide if(mySlideDeck.current == mySlideDeck.slides.length && autoPlayLoop == true){ // This is the last slide, go to the first slide mySlideDeck.goTo(1); } else { // This is not the last slide, go to the next slide mySlideDeck.next(); } } } // sets an initial delay setTimeout(function(){ loopingInterval = setInterval(autoPlayAdvanceLoop,interval); // Run the autoPlayAdvanceLoop() function every interval miliseconds }, firstDelay - interval) autoPlay = true; // Stop autoPlay if the deck is clicked. jQuery('.slidedeck').click(function(){ autoPlay = false; clearInterval(loopingInterval); });
Initial URL
http://getsatisfaction.com/slidedeck/topics/slide_time
Initial Description
Initial Title
SlideDeck AutoPlay Functionality with First Slide Delay
Initial Tags
Initial Language
JavaScript