Home > Web Front-end > JS Tutorial > body text

Drag layer_javascript tips

WBOY
Release: 2016-05-16 19:24:47
Original
954 people have browsed it

[Ctrl A select all Note: If you need to introduce external Js, you need to refresh to execute
]<script> //This javascript 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>
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template