javascript - Mootools - Fx.Tween 与 Fx.Morph

标签 javascript mootools

我是 MooTools 的新手。我注意到 Morph 效果类似于 Tween 效果。

唯一的区别是 tween 用于一个属性,而 morph 用于多个属性。

有人能告诉我这些效果最适合做什么吗,即一种效果比另一种更适合的两种情况。

谢谢!

最佳答案

Fx.Tween 在仅对一个属性设置动画时比 Fx.Morph 性能更高,即:

el.tween('height', 100);

对比

el.morph({
    height: 100
});

你永远不想做的是:

el.tween('height', 100);
el.tween('width', 100);

代替:

el.morph({
    height: 100,
    width: 1000
});

关于javascript - Mootools - Fx.Tween 与 Fx.Morph,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5631298/

相关文章:

javascript - 在函数运行之前如何隐藏 CSS?

javascript - mootools Accordion 不工作

javascript - 在 asp.net 代码隐藏中访问 javascript 变量

javascript - 我们如何从 1 :Array(10) 获取数据

javascript - 如何获取收件箱中的所有邮件? (包括回复)

javascript - 是否有任何脚本可以停止显示 ALT ="text"作为 IE 6 和 7 中的工具提示?

javascript - mootools 类型函数

javascript - 将 null 放置在数组的开头

javascript - JS : Get all months from specific date until today (also using moment. js)

javascript - Mootools 背景改变