标签云

微信群

扫码加入我们

WeChat QR Code

I need to know how to infinitely loop this animation. It is a text scroll animation and I need it to repeat after it's finished.Here is the jQuery:<script type="text/javascript"src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script><script type="text/javascript"> $(document).ready(function(){$(".boxtext").ready(function(){$(".boxtext").animate({bottom:"600px"},50000);});});</script>Here is the CSS for ".boxtext".boxtext {position:absolute;bottom:-300px;width:470px;height:310px;font-size:25px;font-family:trajan pro;color:white;}


You might want to be careful using fonts that not everyone, and given the name, or even most won't have.

2019年04月19日34分26秒

Check my answer stackoverflow.com/questions/14530718/… it's the same story.

2019年04月19日34分26秒

But the second time nothing happens because it's already at 600px, or am I misunderstanding you?

2019年04月19日34分26秒

I suspect that the $(".boxtext").ready will trigger once.

2019年04月20日34分26秒

yea, .boxtext only triggers once when I try your code

2019年04月19日34分26秒

Did you try my latest edit?

2019年04月19日34分26秒

Excellent! This is just the functionality I was in search of

2019年04月19日34分26秒

until stack overflow, it's cyclic recursion

2019年04月19日34分26秒

-1 You're launching immediately into a one-hundred-thousand iteration loop and queueing up one hundred thousand animations. This is wasteful to the extreme.

2019年04月20日34分26秒

+1 for the cat.

2019年04月19日34分26秒

Same as dopplegreener said and it doesn't even continue infinitely but 100000 iterations. Heavy on the performance side and doesn't solve the problem.

2019年04月19日34分26秒

plus 1 for the lady

2019年04月20日34分26秒