Created
October 1, 2013 21:26
-
-
Save infinitylabs/6785376 to your computer and use it in GitHub Desktop.
Revisions
-
infinitylabs created this gist
Oct 1, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ //--------------------------------------------------------------------------// //slider rotateNext = function(){ jQuery('.top-image-container .featured').filter(':visible').fadeOut(1000,function(){ if(jQuery(this).next('div.featured').size()){ jQuery(this).next().fadeIn(1000); } else{ jQuery('.top-image-container .featured').eq(0).fadeIn(1000); } }); }; rotatePrev = function(){ jQuery('.top-image-container .featured').filter(':visible').fadeOut(1000,function(){ if(jQuery(this).prev('div.featured').size()){ jQuery(this).prev().fadeIn(1000); } else{ jQuery('.top-image-container .featured').eq(jQuery('.top-image-container .featured').size()-1).fadeIn(1000); } }); }; rotateStart = function(){ //Rotation + Timing Event play = setInterval(function(){ //Set timer - this will repeat itself every 10 seconds rotateNext(); }, 10000); //Timer speed in milliseconds (10 seconds) }; nextSlider = function(){ clearInterval(play); //Stop the rotation rotateNext(); //Trigger rotation immediately rotateStart(); // Resume rotation return false; //Prevent browser jump to link anchor }; prevSlider = function(){ clearInterval(play); //Stop the rotation rotatePrev(); //Trigger rotation immediately rotateStart(); // Resume rotation return false; //Prevent browser jump to link anchor }; rotateStart(); //Run function on launch