ドラッグオブジェクトを破棄する

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="ja">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<link rel="stylesheet" href="css/main.css" type="text/css" media="all">
<script type="text/javascript" src="js/prototype.js" charset="shift_jis"></script>
<script type="text/javascript" src="js/scriptaculous.js" charset="shift_jis"></script>
<script type="text/javascript"><!--
Event.observe(window, "load", function(){
dragImage1 = new Draggable("photo001", {
onEnd : function (){ dragImage1.destroy(); }
});
new Draggable("photo002", {
onEnd : function (ele){ ele.destroy(); }
});
}, false);
// --></script>
</head>
<body>
<h1>ドラッグオブジェクトを破棄する</h1>
<img src="images/photo1.jpg" width="96" height="54" alt="高原" id="photo001">
<img src="images/photo2.jpg" width="96" height="54" alt="牡丹" id="photo002">
</body>
</html>
サンプルを実行
[戻る]
prototype.jsパーフェクトリファレンス説明などは本書を参考にしてください。