CodeAs follows:
<HTML> <br/> <pead> <br/> <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312 "> <br/> <title> simulated windows upgrade page effect </title> <br/> </pead> <br/> <body> <br/> <script language = JavaScript> <br/> var bordermove = new object (); <br/> bordermove. getx = function (TAG) <br/>{< br/> X = tag. offsetleft; <br/> while (TAG = tag. offsetparent) <br/>{< br/> X + = tag. offsetleft; <br/>}< br/> return X; <br/>}< br/> Bordermove. gety = function (TAG) <br/>{< br/> Y = tag. offsettop; <br/> while (TAG = tag. offsetparent) <br/>{< br/> Y + = tag. offsettop; <br/>}< br/> return y; <br/>}< br/> bordermove. init = function () <br/>{< br/> This. beginwidth = too many Doc ument. body. offsetwidth; <br/> This. beginheight = too many Doc ument. body. offsetheight; <br/> This. beginleft = too many Doc ument. body. offsetleft; <br/> This. begintop = Too many Doc ument. body. offsettop; <br/> This. endleft = This. getx (this. toelementobj) + this. toelementobj. offsetwidth/2; <br/> This. endtop = This. gety (this. toelementobj) + this. toelementobj. offsetheight/2; <br/> This. timeout = 20; <br/> This. movetime = 16; <br/> This. moved = 0 <br/> This. distance = math. SQRT (this. beginleft * This. beginleft + this. endleft * This. endleft); <br/> This. moveleft = (T His. endleft-this. beginleft)/This. movetime; <br/> This. movetop = (this. endtop-this. begintop)/This. movetime; <br/> This. contractwidth = This. beginwidth/This. movetime; <br/> This. contractheight = This. beginheight/This. movetime; <br/> This. timeoutid = NULL; <br/> This. DIV = Comment comment Doc ument. createelement ("Div"); <br/> upload metadata Doc ument. body. appendchild (this. div); <br/>}< br/> bordermove. displa Y = function (srcelementobjid, toelementobjid) <br/>{< br/> If (this. timeoutid! = NULL) <br/>{< br/> window. cleartimeout (this. timeoutid); <br/> too many Doc ument. body. removechild (this. div); <br/> This. DIV = NULL; <br/>}< br/> This. srcelementobj = zookeeper Doc ument. getelementbyid (srcelementobjid); <br/> This. toelementobj = too many Doc ument. getelementbyid (toelementobjid); <br/> This. init (); <br/> with (this. div. style) <br/>{< br/> width = This. beginwidth; <br/> Height = This. beginheight; <br/> border = "1 dotted # cccccc"; <br/> position = "absolute"; <br/> left = This. beginleft; <br/> Top = This. begintop; <br/>}</P> <p> This. move (); <br/>}< br/> bordermove. move = function () <br/>{< br/> This. beginwidth-= This. contractwidth; <br/> This. beginheight-= This. contractheight; <br/> This. beginleft + = This. moveleft; <br/> This. begintop + = This. movetop; <br/> with (this. div. style) <br/>{< br/> width = This. beginwidth; <br/> Height = This. beginheight; <br/> left = This. beginleft; <br/> Top = This. begintop; <br/>}< br/> This. moved ++; <br/> If (this. moved = This. movetime) <br/>{< br/> specify your doc ument. body. removechild (this. div); <br/> This. DIV = NULL; <br/> This. init (); <br/>}< br/> else <br/> {<br/> This. timeoutid = setTimeout ("bordermove. move () ", this. timeout ); <br/>}< br/> </SCRIPT> <br/> <br> <br> <br/> <center> <span id = text> Target Image Object </span> </center> <br/> <br>> <br> </P> <p> <input type = button value = "Event-triggered object" onclick = "bordermove. display (this. ID, 'text') "id =" button "> <br/> </body> <br/> </ptml>
[Ctrl + A select all prompt: you can modify part of the code first, then click to run the Code]
From: http://goaler.xicp.net/Article/ShowArticle.asp? Id = 471