Floating around the advertising code

Source: Internet
Author: User
Tags abs eval string
Advertising

floating around the advertising code

<script language= "javascript" src= "****.js" ></script>

<----

 var delta=0.15
 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 ();
Thefloaters.additem (' FollowDiv1 ', ' document.body.clientwidth-112 ', 230, ' <a href=http://www.***.com/target=_ Blank></a> ');
Thefloaters.additem (' FollowDiv2 ', 12,230, ' <a href=http://www.***.com/target=_blank></a> ');
Thefloaters.play ();

-->



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.