Ad. js
CopyCode Code: var Delta = 0.08
VaR collection;
Function floaters (){
This. Items = [];
This. additem = function (ID, X, Y, content)
{
Document. write ('<Div id =' + ID + 'style = "Z-INDEX: 10; position: absolute; width: 80px; Height: 60px; left:' + (typeof (X) = 'string '? Eval (x): x) + '; top:' + (typeof (y) = 'string '? Eval (y): Y) + '">' + content + '</div> ');
VaR newitem = {};
Newitem. Object = Document. getelementbyid (ID );
Newitem. x = X;
Newitem. Y = y;
This. items [This. Items. Length] = newitem;
}
This. Play = function ()
{
Collection = This. Items
Setinterval ('play () ', 10 );
}
}
Function play ()
{
For (VAR I = 0; I <collection. length; I ++)
{
VaR followobj = Collection [I]. object;
VaR followobj_x = (typeof (Collection [I]. X) = 'string '? Eval (Collection [I]. X): Collection [I]. X );
VaR followobj_y = (typeof (Collection [I]. y) = 'string '? Eval (Collection [I]. Y): Collection [I]. y );
If (followobj. offsetleft! = (Document. Body. scrollleft + followobj_x )){
VaR dx = (document. Body. scrollleft + followObj_x-followObj.offsetLeft) * delta;
DX = (dx> 0? 1:-1) * Math. Ceil (math. Abs (dx ));
Followobj. style. Left = followobj. offsetleft + dx;
}
If (followobj. offsettop! = (Document. Body. scrolltop + followobj_y )){
VaR DY = (document. Body. scrolltop + followObj_y-followObj.offsetTop) * delta;
DY = (dy> 0? 1:-1) * Math. Ceil (math. Abs (dy ));
Followobj. style. Top = followobj. offsettop + dy;
}
Followobj. style. Display = '';
}
}
VaR thefloaters = new floaters ();
// Right
Thefloaters. additem ('followdiv1 ', 'document. body. clientWidth-106 ', 80, '<embed src = images/duilian.swf Quality = high width = 100 Height = 300 type = application/X-Shockwave-flash id = aD wmode = opaque> </embed> ');
// Left
Thefloaters. additem ('followdiv2', 6, 80, '<embed src = images/duilian.swf Quality = high width = 100 Height = 300 type = application/X-Shockwave-flash id = aD wmode = opaque> </embed> ');
Thefloaters. Play ();
// Image format call Method
// <A href = http://www.makewing.com/lanren/ target = _ blank> </a>