- 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 Draggable('element', {ghosting: true or false });
示例
<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', {ghosting:true});
}
</script>
</head>
<body>
<p>Try to drag following image and see how it leaves it
original image at its place. Later change ghosting to false
and repeat the exercise</p>
<img id = "myimage" src = "/images/scriptaculous.gif"/>
</body>
</html>
将产生以下结果 −
scriptaculous_drag_drop.htm
广告