Skip to content

Instantly share code, notes, and snippets.

@jwhardcastle
Created October 30, 2012 02:45
Show Gist options
  • Save jwhardcastle/3978015 to your computer and use it in GitHub Desktop.
Save jwhardcastle/3978015 to your computer and use it in GitHub Desktop.
Quick hack to animate PowerLapse.com
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