| Call method $ ("body"). Couplet ({width:100,height:300,leftcouplet: "http://www.111cn.net/ad/left.swf", Rightcouplet: "http:// Www.111cn.net/ad/right.swf "}); Call parameters width:100,--width Default width 100 height:300,--Total High Default height 300 top:100 the height of the ad from the top Leftcouplet: "http://www.111cn.net/ad/left.swf", left flash address or picture address Leftlink: "http://www.111cn.net/", the left is the connection address, the advertisement is the picture needs Rightcouplet: "http://www.111cn.net/ad/right.swf", right flash address or picture address Rightlink: "http://www.111cn.net/" Right is the connection address, the advertisement is the picture needs JQuery.fn.couplet = function (settings) {
Settings = Jquery.extend ({ WIDTH:100, HEIGHT:300, TOP:100, Leftcouplet: "", Leftlink: "http://www.111cn.net/", Rightcouplet: "", Rightlink: "http://www.111cn.net/" }, Settings); var s = this; Add AD Window S.append ("<div class=" couplet "id=" Leftcouplet "style=" width: "+settings.width+"; left:10px;top:0px; Position: Absolute;background: #e5e5e5; " ></div> "); S.append ("<div class=" couplet "id=" Rightcouplet "style=" width: "+settings.width+"; right:10px;top:0px; Position: Absolute;background: #e5e5e5; " ></div> "); var leftcouplet = S.children ("#leftCouplet"); var rightcouplet = S.children ("#rightCouplet"); Load left ad if (settings.leftCouplet.substring settings.leftCouplet.lastIndexOf ('. ')). toLowerCase () = = ". swf") { Leftcouplet.append ("<div><embed src=" "+settings.leftcouplet+" "width=" "+settings.width+" "height=" "+ settings.height+ "" </embed></div> "); }else{ Leftcouplet.append ("<a href=" "+settings.leftlink+" "target=" _blank "></a> "); } Load Right ad if (settings.rightCouplet.substring settings.rightCouplet.lastIndexOf ('. ')). toLowerCase () = = ". swf") { Rightcouplet.append ("<embed src=" "+settings.rightcouplet+" "width=" "+settings.width+" "height=" "+ settings.height+ "" frameborder= "0" ></embed> "); }else{ Rightcouplet.append ("<a href=" "+settings.rightlink+" ' target= ' _blank ' ></a>"); } var closebtn = "<div class=" Coupletclose "style=" text-align:center;padding:2px 0px;font-size:12px;cursor:pointer " > Close </label> "; Leftcouplet.append (CLOSEBTN); Rightcouplet.append (CLOSEBTN); $ (". Coupletclose"). Click (function () { Leftcouplet.remove (); Rightcouplet.remove (); }); Show couplets Show ();
Function Show () { var wintop = $ (window). scrolltop (); $ (". Couplet"). Animate ({ Top:wintop + settings.top }, 300);
}; Scroll bar Events $ (window). Scroll (function () { $ (". Couplet"). Stop (); Show (); });
}; |