마우스로 드래그되는 레이어창 스크립트

<script>
var dragapproved=false
function drag_dropie(){
if (dragapproved==true){
document.all.showimage.style.pixelLeft=tempx+event.clientX-iex
document.all.showimage.style.pixelTop=tempy+event.clientY-iey
return false
}
}
function initializedragie(){
iex=event.clientX
iey=event.clientY
tempx=showimage.style.pixelLeft
tempy=showimage.style.pixelTop
dragapproved=true
document.onmousemove=drag_dropie
}

if (document.all){
document.onmouseup=new Function("dragapproved=false")
}
</script>

<div id="showimage" style="position:xss__;width:250px;left:300px;top:200px">
<table border="1" onMousedown="initializedragie()" style="cursor:hand" >
<tr>
   <td> 움직일.. 레이어창.. </td>
  </tr>
</table>

</div>

 

댓글
  • No Nickname
    No Comment
  • 권한이 없습니다.
    {{m_row.m_nick}}
    -