Special Effects Introduction
Wheat Bag Home Top advertising Code imitation Wheat bag Home top telescopic ad jquery ad code. After the page load completes, the 2.5 seconds will automatically enlarge the advertisement display, the page content automatically extends downward. Show 8.5 seconds to automatically retract, put small display.
Demo diagram
How to use
1, copy the following CSS style to the head of your HTML:
Copy Code code as follows:
<link rel=stylesheet type=text/css href= "Css/style.css" >
2, copy the following code to the top of the entire page, that is, <body> below.
<div style= "margin:0px auto; width:960px; Display:block "id=js_ads_banner_top>
<a href="/"Target=_blank></a>
</DIV>
<div style= "margin:0px auto; width:960px; Display:none "id=js_ads_banner_top_slide>
<a href="/"Target=_blank></a>
</DIV>
<script type=text/javascript src= "jquery/ Jquery-1.8.3.min.js "> </SCRIPT>
<script type=text/javascript src=" Js/js.js "> </SCRIPT>
3, JS Code Analysis (js.js):
if ($ ("#js_ads_banner_top_slide"). Length) { //To determine whether the current advertisement is expanded, if not, execute the following code
var $slidebannertop = $ ("#js_ads_ Banner_top_slide "), $bannertop = $ (" #js_ads_banner_top ");
settimeout (function () {$bannertop. slideup (1000); $slidebannertop. Slidedown (1000);},2500); After 2500 milliseconds (2.5 seconds), the ad is retracted, the advertisement is stretched out, and the execution time is 1 seconds (1000 milliseconds)
settimeout (function () {$slidebannertop. Slideup (1000,function ()) {$bannertop. Slidedown (1000);});},8500); After 8.5 seconds (8500 milliseconds), the big ad is withdrawn and the small ads are launched.
}
This site download demo address
The above mentioned is the entire content of this article, I hope you can enjoy.