- 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 - 討論
拖放及還原選項
說明
如果設為 true,那麼元素在拖動結束後會返回到其原始位置。它還指定是否在停止拖動操作時呼叫reverteffect 回撥。預設為 false。
語法
以下為設定revert 選項的簡單語法。
new Draggable('element', {revert:true});
示例
<html>
<head>
<title>Draggables Elements</title>
<script type = "text/javascript" src = "/javascript/prototype.js"></script>
<script type = "text/javascript"src = "/javascript/scriptaculous.js"></script>
<script type = "text/javascript">
window.onload = function() {
new Draggable('myimage', {revert:true} );
}
</script>
</head>
<body>
<p>Drag it and then leave it to see the result:</p>
<img id = "myimage" src = "/images/scriptaculous.gif"/>
</body>
</html>
將產生以下結果 −
scriptaculous_drag_drop.htm
廣告