Created
February 1, 2010 15:33
-
-
Save BBB/291749 to your computer and use it in GitHub Desktop.
This file contains 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 characters
var timer; | |
var sections = [] // array of sections, could just be a jQuery selector | |
var i = 0; | |
var cycle = function (sections, i) { | |
if (i < sections.length) { | |
timer = setTimeout(function () { | |
//animate section | |
cycle(i+=1, sections) | |
}, 3000) | |
} else { // start again | |
cycle(0, sections); | |
} | |
} | |
cycle(0 , sections); | |
$('.bubble').click(function () { | |
clearTimeout(timer); | |
//animate section | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment