JavaScript perfectly solves couplet ads
//functioncouplet () {if(arguments.length>=1) This. ObjID = document.getElementById (arguments[0]); if(arguments.length>=2) This. Divtop = arguments[1]; if(arguments.length>=3) This. Divplane = arguments[2]; if(arguments.length>=4) This. scrolldelay = Arguments[4]; if(arguments.length>=5) This. WaitTime = arguments[5]; if(! This. ObjID) {Alert ("Object Name" "+ arguments[0" + "" is invalid, the couplet cannot initialize, please check the object name is correct! "); This. ObjID =NULL;return; }Else{ This. objid.style.position= "Absolute"; This. objid.style.display= "Block"; This. objid.style.zindex=9999; } if("" == This. ObjID.style.top) { if(IsNaN ( This. Divtop)) {Alert (The object vertical position (top) parameter must be a number. ");return; }Else{ This. ObjID.style.top = This. divtop+ "px"; } } if("" == This. ObjID.style.left && "" = = This. ObjID.style.right) { if(IsNaN ( This. Divplane)) {Alert ("Object horizontal position (left| | right) parameter must be a number. ");return; } if( This. divplane>0) This. ObjID.style.left = This. divplane+ "px"; if( This. divplane<0) This. ObjID.style.right = Math.Abs ( This. Divplane) + "px"; } if( This. scrolldelay<15 | | IsNaN ( This. Scrolldelay)) This. scrolldelay = 15; if( This. waittime<500 | | IsNaN ( This. WaitTime)) This. WaitTime = 500; if(arguments.length>=1) This. Start (); Couplet.prototype.start=function(){ if(NULL== This. ObjID)return; varObjcouplet = This; a timer= This. scrolldelay; objcouplet.lastscrolly= 0; Objcouplet.timerid=NULL; Objcouplet.startid=function(){ if("block" = =ObjCouplet.objID.style.display) {Objcouplet.run (); }Else{clearinterval (Objcouplet.timerid); }} Objcouplet.begin=function() {Objcouplet.timerid=setinterval (Objcouplet.startid,timer);} SetTimeout (Objcouplet.begin, This. WaitTime); } Couplet.prototype.run=function(){ if(Document.documentelement &&Document.documentElement.scrollTop) {Uu_scry=parsefloat (DOCUMENT.DOCUMENTELEMENT.SCROLLTOP); }Else if(document.body) {uu_scry=parsefloat (DOCUMENT.BODY.SCROLLTOP); } Uu_divx= Parsefloat ( This. ObjID.style.top.replace ("px", "" ")); Uu_curtop=. 1 * (Uu_scry- This. lastscrolly); Uu_curtop= uu_curtop>0?Math.ceil (uu_curtop): Math.floor (Uu_curtop); This. ObjID.style.top = parsefloat (Uu_divx + uu_curtop) + "px"; This. lastscrolly + =uu_curtop;}//functionmaple_hide (num) {document.getElementById ("Maple" +num). style.display= "None";}// functionFloatjs () {NewCouplet ("Maple1", 100,1); NewCouplet ("Maple2", 450,8); NewCouplet ("Maple3", 100,-8); //New Couplet ("Maple4", 450,-8); } if(Window.addeventlistener) Window.addeventlistener (' Load ', Floatjs,false); ElseWindow.attachevent (' onload ', Floatjs); //document.write (' <div id= ' maple1 "><a href=" http://www.k686.com/"target=" _blank "></a><div style=" position:absolute;width:30px;height : 30px;top:0px;right:5px;cursor:pointer "onclick=" maple_hide (1) ">XX</div></div>");d Ocument.write (' <div id= ' maple2 "><a href=" http://www.k686.com/"target=" _blank "></a><div style=" position:absolute;width:30px;height:30px;top:0px; Right:5px;cursor:pointer "onclick=" Maple_hide (2) ">XX</div></div>");d Ocument.write (' <div id= ' maple3 "><a href=" http://www.k686.com/"target=" _blank "></a><div style=" position:absolute;width:30px;height:30px;top:0px; Right:5px;cursor:pointer "onclick=" Maple_hide (3) ">XX</div></div>");//document.write (' <div id= ' maple4 "><a href=" http://www.k686.com/"target=" _blank "></a></div>");
JavaScript perfectly solves couplet ads