MooTools - 四次过渡



这同时显示带入、出和进出事件的四次过渡。我们举一个在 div 元素中同时包含 quartetic 事件和鼠标按下事件的例子。请看下面的代码。

示例

<!DOCTYPE html>
<html>

   <head>
      <style>
         #quart_in {
            width: 100px;
            height: 20px;
            background-color: #F4D03F;
            border: 2px solid #808B96;
         }
         #quart_out {
            width: 100px;
            height: 20px;
            background-color: #F4D03F;
            border: 2px solid #808B96;
         }
         #quart_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() {
            $('quart_in').addEvent('mousedown', function(event) {
               this.set('tween', {duration: 'long', transition: 'quart:in'});
               this.tween('width', [80, 400]);
            });
            
            $('quart_out').addEvent('mousedown', function(event) {
               this.set('tween', {duration: 'long', transition: 'quart:out'});
               this.tween('width', [80, 400]);
            });
            
            $('quart_in-out').addEvent('mousedown', function(event) {
               this.set('tween', {duration: 'long', transition: 'quart:in-out'});
               this.tween('width', [80, 400]);
            });
         });
      </script>
   </head>
   
   <body>
      <div id = "quart_in"> Quart : in</div><br/>
      <div id = "quart_out"> Quart : out</div><br/>
      <div id = "quart_in-out"> Quart : in-out</div><br/>
   </body>
   
</html>

您将收到以下输出 -

输出

mootools_fxoptions.htm
广告