<!DOCTYPE HTML><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /><title>Untitled document--Shijiazhuang glass partition factory | Shijiazhuang inductive door</title><style>#box{width:100px;Height:100px;background:#966;position:Absolute; Left:100px;Top:100px;cursor:Pointer;}</style></Head><Body><DivID= "box"></Div><Script>varDoc=document;functionGetViewport () {return{Width:Math.max (document.documentelement.clientwidth,document.documentelement.scrollwidth), Height:Math.max (Document.documentelement.clientheight,document.documentelement.scrollheight)};}functionComparenum (x,minnum,maxnum) {Switch(true){ Casex<minnum:x=Minnum; Break; Casex>maxnum:x=Maxnum; Break; defaultxx; } returnx;} Box.style.left='100px'Box.style.top='100px'Box.onmousedown=function(e) {vare=e||window.event;varMaxL=getviewport (). Width- -, Maxt=getviewport (). Height- -; This. Startl=parseint ( This. Style.left); This. Startt=parseint ( This. Style.top); //alert (E.CLIENTX) This. StartX=E.clientx; This. Starty=E.clienty;//alert (maxl+ ': ' +maxt+ ': ' +l+ ': ' +t)Doc.onmousemove=function(e) {Posxy (E,0,0, MAXL,MAXT); }; Doc.onmouseup=function() {Doc.onmousemove=NULL; Doc.onmouseup=NULL; }; return false;}functionPosxy (e,minl,mint,maxl,maxt) {vare=e||window.event;varx=Box.startl-(Box.startx-e.clientx); vary=Box.startt-(Box.starty-e.clienty); Box.style.left=comparenum (X,MINL,MAXL)+'px'Box.style.top=comparenum (Y,MINT,MAXT)+'px'}</Script></Body></HTML>
Support Google browser Mouse drag and drag the mouse pointer effects