<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <style type="text/css"> #showdiv{ position:relative; cursor:pointer; }
</style> <script type="text/javascript"> var ie=document.all;
var notie=document.getElementById && !document.all;
var isdrag=false; var x,y;
var dobj;
function selectmouse(e){
var obj = notie ? e.target : event.srcElement;
var topelement = notie ? "HTML" : "BODY";
while (obj.tagName != topelement && obj.id != "showdiv")
{ obj = notie ? obj.parentNode : obj.parentElement; }
if (obj.id=="showdiv") {
isflag = true;
dobj = obj;
tx = parseInt(dobj.style.left+0);
ty = parseInt(dobj.style.top+0);
x = notie ? e.clientX : event.clientX;
y = notie ? e.clientY : event.clientY;
document.onmousemove=move;
return false; } }
function move(e) {
if (isflag)
{ dobj.style.left = notie ? tx + e.clientX - x : tx + event.clientX - x;
dobj.style.top = notie ? ty + e.clientY - y : ty + event.clientY - y; return false;
} } document.onmousedown=selectmouse;
document.onmouseup=new Function("isflag=false");
</script> </head>
<body > <div><img src="images/adver3.jpg" id="showdiv"></div>
</body> </html>