Here is an ad bit of jquery code, there are two different ad bits, one is floating in the middle, the display automatically disappears after 5 seconds, and only once per day (cookie implementation):
//the js===================== of ===================== ad bit$ (document). Ready (function(){ //AD Center floating 5 seconds after auto-disappear or click to close$ ("#bannerFloatCenter"). CSS ("left", ($ (document). Width ()-250)/2);//depending on the cookie, decide if you want to display the center area ad: if(!Issetcookie ()) { $("#bannerFloatCenter"). FadeIn (2000,function() {window.settimeout (' $ ("#bannerFloatCenter"). Slideup (1000); ', 5000); }); $("#bannerFloatCenter span"). Click (function(){ $("#bannerFloatCenter"). Slideup (1000); }); } //the right column of the ad bit floats with the scroll bar scroll up and down, you can click Close to disappear$ (window). Scroll (function() { varOffsetTop = + $ (window). scrolltop () + "px"; $("#bannerFloatFlowScroll"). Animate ({top:offsettop}, {duration:300, queue:false }) }); $("#bannerFloatFlowScroll span"). Click (function(){ $("#bannerFloatFlowScroll"). Slideup (); });});
Here is a DIV for two ad positions:
<!--ad Center floats after 5 seconds to disappear automatically or click Close disappears-<div id= "Bannerfloatcenter" style= "Position:absolute;z-index:2;left : 483px; top:275px; border: #9DCE63 4px solid; Display:none; " > <a href= "http://www.cntronics.com/public/lecture/list?cid=7" >baseurl ();? >/images/semiwelcomebanner_250.jpg "/></a> <span title=" Close "style=" position:absolute; cursor:pointer;left:213px;top:-17px;font-size:12px; " >[Close]</span> </div> <!--the right column of the ad bit moves up and down with the scroll bar scrolling, you can click Close disappears--<div id= "Bannerfloatflowscroll" Style= "Position:absolute; Z-index:2; right:50px;top:133px; " > <a href= "http://www.cntronics.com/public/whitepaper/index/sp/22" >baseurl ();? >/images/semisidebanner_120.jpg "/></a> <span title=" Close "style=" position:absolute; cursor:pointer;left:80px;top:-14px;font-size:12px; " >[close]</span> </div>
Another way to do this is to put the settimeout () function out:
<script language= "JavaScript" > function reloadnewquestion () { // jquery code var no = math.random (); var url = "<?php echo $this->baseurl ();? >/webinar/index/newquestion/no/"+no; $ (". Content.content_1 ul"). Load (URL); SetTimeout ("reloadnewquestion ()", 60000); } </script><script language= "JavaScript" > $ (document). Ready () { reloadnewquestion (); } </script>
After implementing jquery triggering an event, stay for 5 seconds, and then trigger the following event