可随意拖动的图片&文字
即拷即用:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<TITLE>可随意拖动的图片&文字</TITLE>
<STYLE>#p1 {
FONT-FAMILY: 宋体; FONT-SIZE: 9pt;}
.drag {
CURSOR: hand; POSITION: relative
}
</STYLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<META content="MSHTML 5.00.2014.210" name=GENERATOR></HEAD>
<BODY>

<SCRIPT language=JavaScript><!--
/*
modified by mars ,www.joysoft.net
*/

var dragapproved=false
var z,x,y
function move(){
if (event.button==1&&dragapproved){
z.style.pixelLeft=temp1+event.clientX-x
z.style.pixelTop=temp2+event.clientY-y
return false
}
}
function drags(){
if (!document.all)
return
if (event.srcElement.className=="drag"){
dragapproved=true
z=event.srcElement
temp1=z.style.pixelLeft
temp2=z.style.pixelTop
x=event.clientX
y=event.clientY
document.onmousemove=move
}
}
document.onmousedown=drags
document.onmouseup=new Function("dragapproved=false")

function highlight(n){
document.forms[0].elements[n].focus();
 document.forms[0].elements[n].select();

}
// --></SCRIPT>

<img src="http://member.netease.com/~disney/sample1/Moveable/win98.gif" class="drag"><br>
<img src="http://member.netease.com/~disney/sample1/Moveable/winnt.gif" class="drag"><br>
<h1 class="drag" id=p1>Microsoft Windows98 & WindowsNT</h1>

</BODY>
</HTML>