Skip to content

Instantly share code, notes, and snippets.

@hite
Created September 13, 2010 06:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hite/576881 to your computer and use it in GitHub Desktop.
Save hite/576881 to your computer and use it in GitHub Desktop.
//animate function
var from = -627,to = 0,step = 100,duration = 50;
var flag = -1;
var timer = setInterval(function(){
if(to>from){
flag = 1;
}
from= from+flag*10;
if(flag*from>to){
from = to;
clearInterval(timer);
}
$("tbScrollableMenu").style.marginLeft = from +'px';
},50)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment