gpt4 book ai didi

javascript - 暂停 script.aculo.us 效果

转载 作者:行者123 更新时间:2023-11-28 02:52:51 25 4
gpt4 key购买 nike

是否可以暂停所有 script.aculo.us 效果?因此,当我需要时,我可以从暂停的状态恢复它们。

最佳答案

看起来不会是这样,但我发现了一个帖子,对此有一个有趣的看法,我不知道效果的参数是否会保持在取消时的状态,或者是否处于原始状态,但可能值得修改。

来自:http://groups.google.com/group/prototype-scriptaculous/browse_thread/thread/f37ea88cba01c8a5

It seems that, for core effects with Script.aculo.us(including Effect.Move), the method cancel() works.

Core effects include: Effect.Highlight, Effect.Morph, Effect.Move, Effect.Opacity, Effect.Scale, Effect.Parallel, Effect.Tween

So you can do something like:

var myEffect = new Effect.Move(object, { duration: 5.0, x: 20, y: -30,
mode: 'relative' });<br/>
myEffect.cancel();

You can keep the effect reference object(in this example, myEffect) to stop it whenever you want, and start over again later with a new move effect.

关于javascript - 暂停 script.aculo.us 效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3428492/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com