script.aculo.us - 淡出效果


說明

淡出效果結合了核心效果,讓元素以動畫方式從文件流中消失。

在此情況下,不透明度和移動核心效果結合使用,使元素看上去從頁面上落向地面。

語法

您可以使用以下兩種形式之一來使用此效果 -

new Effect.DropOut('id_of_element', [options]);
OR
new Effect.DropOut(element, [options]);

特定於效果的引數

此效果除了 通用引數 外沒有任何其他引數。

示例

<html>
   <head>
      <title>script.aculo.us examples</title>
		
      <script type = "text/javascript" src = "/javascript/prototype.js"></script>
      <script type = "text/javascript" src = "/javascript/scriptaculous.js?load = effects"></script>

      <script type = "text/javascript">
            function DropOutEffect(element){
            new Effect.DropOut(element, {duration:3});
         }

         function ShowImage(element){
            new Effect.Appear(element,{duration:1, from:1, to:1.0});
         }
      </script>
   </head>

   <body>	
      <div onclick = "ShowImage('myimage')">
         Click me to display the image
      </div>
      <br />

      <div id = "myimage" onclick = "DropOutEffect(this);">
         <img src = "/images/scriptaculous.gif" alt = "script.aculo.us" />
         <h2>Click me to Drop me out</h2>
      </div>
   </body>
</html>

這將生成以下結果 -

scriptaculous_effects.htm
廣告