View Full Version : Drag & Drop

Apr 28th, 2007, 06:32 PM
Sorry about my last post.
There is some problem when I tried to make a drag gable image. Before I write: return = false
It sometimes stops dragging. Why should it use the return statement?
In what condition do we have to use this way? Is it only for events?


<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 2</title>
<script language="javascript">
function $(id){
return document.getElementById(id);
var bToggle = 0;
var obj;
var ix;
var iy;
function Moving(obj,iX,iY){
e = e || event;
obj.style.left = e.clientX - iX;
obj.style.top = e.clientY - iY;
return false;
$("img1").onmousedown = function(e){
bToggle = 1;
e = e || event;
ix = e.clientX - this.offsetLeft;
iy = e.clientY - this.offsetTop;
return false;
bToggle = 0;

<img id="img1" src="disc.jpg" style="position:absolute;top:90;" width="150" height="150"/>