script.aculo.us - SlideDown 效果


說明

此效果模擬百葉窗,受影響元素的內容向下滾動。

語法

你可以使用以下兩種形式之一來使用此效果 −

new Effect.SlideDown('id_of_element', [options]);
OR
new Effect.SlideDown(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 SDEffect(element){
            new Effect.SlideDown(element, {duration:3});
         }
      </script>
   </head>
   
   <body>
      <div id = "myimage" onclick = "SDEffect(this);">
         <img src = "/images/scriptaculous.gif" alt = "script.aculo.us" />
         <h2>Click me to Slide Down the Image</h2>
      </div>
   </body>
</html>

將產生以下結果 −

scriptaculous_effects.htm
廣告