You are here: irt.org | FAQ | DHTML | Q1423 [ previous next ]
Try:
<html>
<head>
<script language="JavaScript"><!--
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown = myDown;
}
function myDown(e) {
if (document.layers) {
document.layers['x'].left = e.screenX - window.screenX - (window.outerWidth - window.innerWidth);
document.layers['x'].top = e.screenY - window.screenY - (window.outerHeight - window.innerHeight) + 25;
}
else if (document.all) {
document.all('x').style.posLeft = window.event.x;
document.all('x').style.posTop = window.event.y;
}
}
//--></script>
</head>
<body onMouseDown="myDcroll()">
<div id="x" style="position:absolute;"><img src="image.gif" height="100" width="100"></div>
</body>
</html>