39、将鼠标按字上移动鼠标

39、将鼠标按字上移动鼠标

<style>

.drag{position:relative;cursor:hand}

</style>

<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>

<span style="font-family:幼圆;font-size: 9pt"><font color=#000000 class="drag">将鼠标按在这些字上移动鼠标试试看!啦啦啦</font></span>

 

<style>

.drag{position:relative;cursor:hand}

</style>

<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>

<span style="font-family:幼圆;font-size: 9pt"><font color=#000000 class="drag">将鼠标按在这些字上移动鼠标试试看!啦啦啦</font></span>

 

Write a comment

Comments: 0