MooTools - Back Transition
首先进行返回转换,然后全部向前转换。让我们举一个例子,我们将 鼠标按下 事件与来回事件一起添加到 div 元素。看看下面的代码。
示例
<!DOCTYPE html> <html> <head> <style> #back_in { width: 100px; height: 20px; background-color: #F4D03F; border: 2px solid #808B96; } #back_out { width: 100px; height: 20px; background-color: #F4D03F; border: 2px solid #808B96; } #back_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() { $('back_in').addEvent('mousedown', function(event) { this.set('tween', {duration: 'long', transition: 'back:in'}); this.tween('width', [80, 400]); }); $('back_out').addEvent('mousedown', function(event) { this.set('tween', {duration: 'long', transition: 'back:out'}); this.tween('width', [80, 400]); }); $('back_in-out').addEvent('mousedown', function(event) { this.set('tween', {duration: 'long', transition: 'back:in-out'}); this.tween('width', [80, 400]); }); }); </script> </head> <body> <div id = "back_in"> Back : in</div><br/> <div id = "back_out"> Back : out</div><br/> <div id = "back_in-out"> Back : in-out</div><br/> </body> </html>
您将收到以下输出 −