如何加速Element.fade功能

时间:2015-07-09 08:30:13

标签: mootools

我想加快fade()函数,但函数接受的参数是关于不透明度,而不是速度。我该怎么办?

谢谢

1 个答案:

答案 0 :(得分:0)

您可以设置新的补间持续时间,如:

$('slow').set('tween', {duration: 5000});
$('fast').set('tween', {duration: 100});
$$('div').fade();
<script src="https://ajax.googleapis.com/ajax/libs/mootools/1.5.1/mootools-yui-compressed.js"></script>


<div id="slow">I'm going to fade slowly!</div>
<div id="normal">I'm going to fade normal speed!</div>
<div id="fast">I'm going to fade fast!</div>

jsFiddle:http://jsfiddle.net/8vjsfpfq/