Created
October 13, 2012 20:20
-
-
Save nilocesar/3886004 to your computer and use it in GitHub Desktop.
create filmstrip by D3
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
animateArrows( "#filmStrip", 107, 29 ) | |
//-------------------------------------- | |
// ANIMATE FILM STRIP | |
//-------------------------------------- | |
function animateArrows(target, amount, numFrames) | |
{ | |
var incr = amount; | |
var newPos = 0; | |
moveImage(); | |
function moveImage() | |
{ | |
newPos -= incr; | |
$(target).css('marginTop', newPos); | |
if(newPos > -(amount*numFrames)) | |
{ | |
if( target == "#loaderStrip" ) | |
{ | |
setTimeout(moveImage, 60); | |
} | |
else | |
{ | |
setTimeout(moveImage, 20); | |
} | |
} | |
else | |
{ | |
if( target == "#loaderStrip" ) | |
{ | |
animateArrows( target, amount, numFrames ); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment