Drag Layer _javascript Tips

Source: Internet
Author: User
<ptml> <pead> <title> Drag layer </title> <style> td{font-size:12px;} /* Analog Form/* vwin{Position:absolute; border-top:2px outset buttonhighlight; border-left:2px outset buttonhighlight; border-bottom:2px outset Buttonshadow; border-right:2px outset Buttonshadow; }. Vwintit{height:18px;background-color: #000099; color: #ffffff; font-weight:bold;cursor:move;} . Vwinbody{background-color: #D6D3CE;} </style> </pead> <body> <table id= "Win01" class= "Vwin" width= "" height= "" cellspacing= "0 "cellpadding=" 0 "border=" 0 "> <tr> <td class=" Vwintit "forid=" win01 ">  window one </td > </tr> <tr> <td class= "Vwinbody" forid= "Win01" > </td> </tr> </table> <table id= "win02" class= "Vwin" width= "0" height= "cellspacing=" adding= "0" border= "0" > <tr> <td class= "Vwintit" forid= "win02" >  window two </td> </tr&gt ; <tr> <td class= "Vwinbody" forid= "win02" > </td> </tr> </table&gt ; <table id= "win03" class= "Vwin" width= "0" height= "0" cellspacing= "0" > cellpadding= Gt &LT;TD class= "Vwintit" forid= "win03" >  Windows three </td> </tr> <tr> &LT;TD class= "Vwinbody" forid= "win03" > </td> </tr> </table> <script>//this J Avascript was writen by Dron var md=false,mobj,ox,oy,index=1000; function Document.onmousedown () {winfocus (); if (event.srcelement.classname== "Vwintit") {MD = true; Mobj = document.getElementById (Event.srcElement.forid); Ox = mobj.offsetleft-event.x; Oy = Mobj.offSettop-event.y; } document.onmouseup=function () {Md=false} function Document.onmousemove () {if (MD) {mobj.style.left = event.x + ox; Mobj.style.top = Event.y + Oy; } function Winfocus () {Fobj=document.getelementbyid (Event.srcElement.forid); if (Fobj==null) {return false} if (Fobj.style.zindex!=index) {index = index + 1; Fobj.style.zindex=index; }} Document.onclick=winfocus; </script> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.