由鼠標(biāo)按住可移文字
發(fā)布時間:2008-12-19 閱讀數(shù): 次 來源:網(wǎng)樂原科技
<script language="JavaScript">
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")
</script>
將鼠標(biāo)按在這些字上移動鼠標(biāo)試試看!啦啦啦