MooTools - quint transition
这显示了一个五次过渡,其中包含 in、out 和 in-out 事件。让我们举个例子,我们将 鼠标按下 事件与五次事件一起添加到 div 元素。看看下面的代码。
示例
<!DOCTYPE html> <html> <head> <style> #quintic_in { width: 100px; height: 20px; background-color: #F4D03F; border: 2px solid #808B96; } #quintic_out { width: 100px; height: 20px; background-color: #F4D03F; border: 2px solid #808B96; } #quintic_in-out { width: 100px; height: 20px; background-color: #F4D03F; border: 2px solid #808B96; } </style> <script type = "text/javascript" src = "MooTools-Core-1.6.0.js"></script> <script type = "text/javascript" src = "MooTools-More-1.6.0.js"></script> <script type = "text/javascript"> window.addEvent('domready', function() { $('quintic_in').addEvent('mousedown', function(event) { this.set('tween', {duration: 'long', transition: 'quint:in'}); this.tween('width', [80, 400]); }); $('quintic_out').addEvent('mousedown', function(event) { this.set('tween', {duration: 'long', transition: 'quint:out'}); this.tween('width', [80, 400]); }); $('quintic_in-out').addEvent('mousedown', function(event) { this.set('tween', {duration: 'long', transition: 'quint:in-out'}); this.tween('width', [80, 400]); }); }); </script> </head> <body> <div id = "quintic_in"> Quintic : in</div><br/> <div id = "quintic_out"> Quintic : out</div><br/> <div id = "quintic_in-out"> Quintic : in-out</div><br/> </body> </html>
您将收到以下输出