<Title> www.jb51.net drag Layer Effect Code </Title>
<Script language = "JavaScript" type = "text/JavaScript">
VaR OBJ = 0;
VaR x = 0;
Var y = 0;
VaR Ie = (navigator. appversion. indexof ("MSIE ")! =-1); // IE
VaR FF = (navigator. useragent. indexof ("Firefox ")! =-1); // Firefox
Function find (EVT, objdiv ){
OBJ = objdiv
If (FF ){
X = document.doc umentelement. scrollleft + EVT. layerx;
Y = document.doc umentelement. scrolltop + EVT. layery;
If (document.doc umentelement. scrolltop> 0 ){
Y = EVT. layery-document.doc umentelement. scrolltop;
}
If (document.doc umentelement. scrollleft> 0 ){
X = EVT. layerx-document.doc umentelement. scrollleft;
}
}
If (IE ){
X = document.doc umentelement. scrollleft + EVT. offsetx;
Y = document.doc umentelement. scrolltop + EVT. offsety;
If (document.doc umentelement. scrolltop> 0 ){
Y = EVT. offsety-document.doc umentelement. scrolltop;
}
If (document.doc umentelement. scrollleft> 0 ){
X = EVT. offsetx-document.doc umentelement. scrollleft;
}
}
}
Function dragit (EVT ){
If (OBJ = 0 ){
Return false
}
Else {
OBJ. style. Left = EVT. clientx-x + "PX ";
OBJ. style. Top = EVT. clienty-y + "PX ";
}
}
</SCRIPT>
</Head>
<Body style = "margin: 0" onmousemove = "dragit (event)" onmouseup = "OBJ = 0">
<Div id = "AAA" style = "width: 200pt; Height: 200pt; position: absolute">
<Div id = "AA" style = "width: 200pt; Height: 20pt; position: absolute" onmousedown = "find (event, document. getelementbyid ('aaa') "> </div>
<Textarea id = "textarea1" Cols = "20" rows = "2"> </textarea>
</Div>
</Body>
</Html>