Ad. JS:
---------------------------------------------------------------
VaR Delta = 0.45;
VaR collection;
VaR closeb = false;
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 () ', 30 );
}
}
Function play ()
{
If (screen. Width <= 800 | closeb)
{
For (VAR I = 0; I <collection. length; I ++)
{
Collection [I]. Object. style. Display = 'none ';
}
Return;
}
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 = '';
}
}
Function closebanner ()
{
Closeb = true;
Return;
}
VaR thefloaters = new floaters ();
//
Thefloaters. additem ('followdiv1 ', 'document. Body. clientWidth-100', 100, '<a href = http://www.wqfq.cn target = _ blank>
</a> <br>
');
Thefloaters. additem ('followdiv2', 0,100, '<a href = http://www.wqfq.cn target = _ blank>
</a> <br>
');
Thefloaters. Play ();
---------------------------------------------------------------------------
Add in head:
<SCRIPT type = "text/JavaScript" Language = "javascript1.2" src = "ad. js"> </SCRIPT>