<Html> <Head> <Title> dynamic moving layer </title> <Body bgcolor = "# ADBAC9"> <Div id = "div1" class = "yellow" style = "VISIBILITY: visible; Background-color: # FFFF00; Position: absolute; top: 60; left: 200; Width: 360; height: 250; Filter: revealTrans (transition = 12, 'duration = 0.1) BlendTrans (duration = 0.1) "> <Div id = title onmousedown = DIVDown ("div1 ") Style = "background-color: # 30608F; padding: 2px; Font-size: 13px; text-indent: 5; Color: # FFFFFF; cursor: move "> title </div> Style = "position: absolute; right: 2; top: 2" border = "0" Src = "close.gif" width = "15" height = "15"> </Div> <Script language = "JavaScript"> Var Obj = "none "; Var pX Var pY Document. onmousemove = DIVMove; Document. onmouseup = DIVUp; Function DIVDown (tag ){ Obj = tag; PX = parseInt (document. all (Obj). style. left)-event. x; PY = parseInt (document. all (Obj). style. top)-event. y; } Function DIVMove (){ If (Obj! = "None "){ Document. all (Obj). style. left = pX + event. x; Document. all (Obj). style. top = pY + event. y; Event. returnValue = false; } } Function DIVUp () {Obj = "none ";} Function Hide (divid ){ Divid. filters. revealTrans. apply (); Divid. style. visibility = "hidden "; Divid. filters. revealTrans. play (); } </Script> </Body> </Html> |