
- script.aculo.us 教程
- script.aculo.us - 主頁
- script.aculo.us - 概述
- script.aculo.us - 模組
- script.aculo.us - 視覺效果
- script.aculo.us - 拖放
- script.aculo.us - 排序元素
- script.aculo.us - 建立滑塊
- script.aculo.us - 自動補全
- script.aculo.us - 內聯編輯
- script.aculo.us 資源
- script.aculo.us - 快速指南
- script.aculo.us - 資源
- script.aculo.us - 討論
script.aculo.us - 移除效果
說明
關閉效果從頂部和底部向中心垂直調整目標元素的尺寸,然後從文件佈局中將其刪除。
添加了一些不透明度閃爍,以幫助模仿其現實世界的靈感。
語法
可以使用以下兩種形式之一來使用此效果 −
new Effect.SwitchOff('id_of_element', [options]); OR new Effect.SwitchOff(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 SWEffect(element){ new Effect.SwitchOff(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 = "SWEffect(this);"> <img src = "/images/scriptaculous.gif" alt = "script.aculo.us" /> <h2>Click me to Switch me off!</h2> </div> </body> </html>
將產生以下結果 −
scriptaculous_effects.htm
廣告