Jump to content

Drag and Drop


The Little Guy

Recommended Posts

Drag and drop what?

<html>
<head>
<script language="JScript">
function startDrag(e)
{
var offsetX = event.clientX-parseInt(e.style.left);
var offsetY = event.clientY-parseInt(e.style.top);
document.onmousemove = function()
{
	e.style.left = event.clientX-offsetX;
	e.style.top = event.clientY-offsetY;
}
document.onmouseup=function()
{
	document.onmousemove=null;
}
}
</script>
</head>
<bodY>
<div STYLE="position:absolute;width:100px;height:100px;background-color:#0000FF;left:0px;top:0px" onmousedown="startDrag(this)"></div>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/119402-drag-and-drop/#findComment-615590
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.