开发者

Can't get YUI animations to wait until the first has finished

开发者 https://www.devze.com 2023-01-01 07:52 出处:网络
I have 3 animations that run when I load my page. A header descends from the top and a footer ascends from the bottom. Also, my main logo goes from fully transparent to fully opaque.

I have 3 animations that run when I load my page. A header descends from the top and a footer ascends from the bottom. Also, my main logo goes from fully transparent to fully opaque.

I'm using the YUI framework for the animations.

My problem is that they all happen at the same time. I'd like the header & footer animations to go at the same time but the logo to wait until the others have finished.

setTimeout doesn't appear to work (the animation triggers i开发者_StackOverflow社区mmediately). I've also tried a while loop to wait until the currentFrame = a certain number but my loops seem to stop everything from working.

Any help would be gratefully received.

Thanks

Andy


Have a look at this example: http://developer.yahoo.com/yui/examples/animation/anim-chaining.html

Or if you're using YUI 3: http://developer.yahoo.com/yui/3/examples/anim/anim-chaining.html

0

精彩评论

暂无评论...
验证码 换一张
取 消