Activate JS flash for couplet advertisements

Source: Internet
Author: User

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>

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.