MooTools - Pow Transition



它用于生成带有入、出、入出事件的四次方、三次方、四次方和五次方过渡。我们举一个例子,其中,我们在 div 元素上添加一个 **鼠标按下** 事件以及不同的事件。请看以下代码。

示例

<!DOCTYPE html>
<html>

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

您将收到以下输出 −

输出

mootools_fxoptions.htm
广告