Created
October 30, 2012 02:45
-
-
Save jwhardcastle/3978015 to your computer and use it in GitHub Desktop.
Quick hack to animate PowerLapse.com
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
function animateSlider() { | |
var mx = $( '#slider' ).slider( 'option', 'max' ); | |
var _animate = function(reset) { | |
if(reset) $( '#slider' ).slider( 'option', 'value', 1); | |
var pos = $( '#slider' ).slider( 'option', 'value' ); | |
if(pos < mx) { | |
$( '#slider' ).slider( 'option', 'value', pos+1 ); | |
setTimeout(function() {_animate(0)}, 100); | |
} else { | |
setTimeout(function () {_animate(1)}, 3000); | |
} | |
} | |
_animate(1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment