Scriptaculous 中的排队 Effect.Parallels 不起作用
每个动画块都分组在 Effect.Parallel 中,同时运行。效果很好。
然后,我希望每个 Effect.Parallels 按顺序触发,并有延迟。第二个块不会等待轮到它。当函数运行时它会被触发。为什么?!
///// FIRST BLOCK /////
new Effect.Parallel([
new Effect.Morph...
], { queue: 'front' });
///// SECOND BLOCK /////
new Effect.Parallel([
Element.toggleClassName($$('#add_comment_button .glyph').first(), 'yay')
], { sync: true, queue: 'end', delay: 1 });
///// THIRD BLOCK /////
new Effect.Parallel([
new Effect.SlideUp...
], { queue: 'end', delay: 4 });
Each block of animations, grouped in an Effect.Parallel, runs simultaneously. That works fine.
Then, I want each of the Effect.Parallels to trigger sequentially, with a delay. The second block doesn't wait its turn. It fires when the function is run. Why?!
///// FIRST BLOCK /////
new Effect.Parallel([
new Effect.Morph...
], { queue: 'front' });
///// SECOND BLOCK /////
new Effect.Parallel([
Element.toggleClassName($('#add_comment_button .glyph').first(), 'yay')
], { sync: true, queue: 'end', delay: 1 });
///// THIRD BLOCK /////
new Effect.Parallel([
new Effect.SlideUp...
], { queue: 'end', delay: 4 });
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试删除 Effect.Parallel 并仅在每个效果上定义选项 {queue:'end'} ?您可能还想从第二个块中删除同步选项
Did you try dropping the Effect.Parallel and just defining option {queue:'end'} on each effect? You might also want to remove sync option from 2nd block