The code is as follows:
hEAD>
Var bordermove = new Object ();
Bordermove.getx = function (tag)
{
x = tag.offsetleft;
While (tag = tag.offsetparent)
{
x = tag.offsetleft;
}
Return X;
}
Bordermove.gety = function (tag)
{
y = tag.offsettop;
While (tag = tag.offsetparent)
{
Y = tag.offSettop;
}
Return Y;
}
Bordermove.init = function ()
{
THIS.BEGINWIDTH = WINDOW.Document.body.offsetwidth;
THIS.BEGINHEIGHT = window.document.body.offsetheight;
THIS.BEGINLINLINLT = Window.Document.body.offsetleft;
THIS.BEGINTOP = WINDOW.Document.body.offsettop;
THIS.ENDLEFT = this.getx (this.toElementobj) this.toElementobj.OffSetWidth / 2;
This.Endtop = this.gety (this.toElementobj) this.toElementObj.offsetHeight / 2;
THIS.Timeout = 20;
THIS.MOVETIME = 16;
THIS.MOVED = 0
This.distance = math.sqrt (this.beginleft * this.beginleft this.enDeft * this.endeft);
THIS.MOVELEFT = (this.enDeft - this.beginleft) / this.movetime;
THIS.MOVETOP = (this.endtop - this.begintop) / this.movetime;
THIS.CONTRACTWIDTH = this.beginwidth / this.movetime;
THIS.CONTRACTHEIGHT = this.beginheight / this.movetime;
THIS.TimeOutid = NULL;
this.div = window.document.createElement ("DIV");
Window.Document.body.Appendchild (this.div);
}
Bordermove.display = function (srcelementobjid, TOEEEMENTOBJID)
{
IF (this.timeOutid! = null)
{
WINDOW.CLEARTIMEOUT
Window.Document.body.removechild (this.div); this.div = null;
}
This.SrcelementObj = window.document.getlementByid (srcelementobjid);
THIS.TOELEMENTOBJ = WINDOW.Document.getlementByid (TOEEEMENTOBJID);
this.init ();
with (this.div.style)
{
Width = this.beginwidth;
HEIGHT = this.beginheight;
Border = "1 dotted #ccccc";
Position = "absolute";
Left = this.beginleft;
TOP = this.begintop;
}
THIS.MOVE ();
}
Bordermove.move = function ()
{
THIS.BEGINWIDTH - = this.ContractWidth;
THIS.BEGINHEIGHT - = this.ContractHeight;
THIS.BEGINLINLEFT = this.moveleft;
THIS.BEGINTOP = this.movetop;
with (this.div.style)
{
Width = this.beginwidth;
HEIGHT = this.beginheight;
Left = this.beginleft;
TOP = this.begintop;
}
THIS.MOVED ;
IF (this.moved == this.movetime)
{
Window.Document.body.removechild (this.div);
THIS.DIV = NULL;
this.init ();
}
Else
{
This.TimeOutid = setTimeout ("Bordermove.Move ()", this.timeout;
}
}
script>
body>
html> [Ctrl A full selection prompt: You can modify some code first, then run the code again]