Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (sum<47){//ignore small error
- //if time sum is less than 47,since we want a 50ms-per animation
- // we wait to count the sum to more than the number
- console.log("still wating: ",sum)
- }
- else{
- //here the sum is bigger what we want,so make the UI change
- console.log("------------runing: ",sum)
- sum=0 //reset the sum to caculate the next diff
- if(cur < 100)
- {
- p.style.width=++cur+"px"
- }
- else{
- clearInterval(temp)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement