Similar to the Baidu Union couplet advertisement implementation code and the Baidu Union Couplet
The source code is as follows:
<Style type = "text/css"> * {margin: 0; padding: 0;} body {height: 2000px ;}. floatAd {width: 124px; height: 299px; text-align: center; position: fixed; margin-left: 0; top: pixel; _ position: absolute; background: url (http://files.jb51.net/demoimg/2014/bg_slide2_120_270.png) no-repeat ;}. floatAd a {display: block ;}. floatAd img {border: none ;}. floatAd. closeAd {width: 50px; height: 20px; display: block; cursor: pointer; margin: 9px 0 0 auto ;}. flAd {left: 0 ;}. frAd {right: 0 ;} </style> <div class = "floatAd flAd"> <a href = "#" target = "_ blank"> </a> <span class = "closeAd"> </span> </div> <div class = "floatAd frAd"> <a href = "#" target = "_ blank"> </a> <span class = "closeAd"> </span> </div> <script type = "text/javascript"> $ (". closeAd "). click (function () {$ (this ). parent (". floatAd "). hide () ;})/* for ie6 */function scrolglad (obj) {var obj = ". "+ obj; var adTop = $ (". floatAd "). offset (). top; // alert (adTop); $ (window ). scroll (function () {$ (". floatAd ").css ({top: $ (window ). scrollTop () + adTop})} $ (function () {// For ie6, simulate position: fixed effect if ($. browser. msie & parseInt ($. browser. version) = 6) {scrolglad ("floatAd") ;}}) </script>
We can also change the code to achieve the effect of "unilateral display of floating advertisements, multiple ad carousel presentations". The changed source code:
<Style type = "text/css"> * {margin: 0; padding: 0;} body {height: 2000px ;}. floatAd {width: 124px; height: 299px; text-align: center; position: fixed; margin-left: 0; top: pixel PX; right: 0; _ position: absolute; background: url (http://files.jb51.net/demoimg/2014/bg_slide2_120_270.png) no-repeat ;}. floatAd a {display: block ;}. floatAd img {border: none ;}. floatAd. closeAd {width: 50px; height: 20px; display: block; cursor: pointer; margi N: 9px 0 0 auto ;} </style> <div class = "floatAd"> <a href = "#" target = "_ blank"> </a> <a href = "#" target = "_ blank" style = "display: none; "> </a> <span class =" closeAd "> </span> </div> <script type = "text/javascript"> $ (". closeAd "). click (function () {$ (". floatAd "). hide () ;})/* Switch floating advertisement */function changePic (obj, times) {var num = 0, obj = $ (". "+ obj +"> a "), times = times * 1000, len = obj. length; // alert (len); setInterval (function () {num ++; num = num> len-1? 0: num; // console. log (num); $ (obj ). eq (num ). show (). siblings (""). hide () ;}, times)}/* for ie6 */function scrolglad (obj) {var obj = ". "+ obj; var adTop = $ (". floatAd "). offset (). top; // alert (adTop); $ (window ). scroll (function () {$ (". floatAd ").css ({top: $ (window ). scrollTop () + adTop})} $ (function () {// For ie6, simulate position: fixed effect if ($. browser. msie & parseInt ($. browser. version) = 6) {scrolglad ("floatAd");} // perform scheduled switching between image ad changePic ("floatAd", 2 ); // switch the advertising image display every two seconds, with controllable interval}) </script>
I want to apply for an advertisement of the Baidu Alliance couplet style in Yifang? How can we do this? You can also send me a private email for help.
Use your website to apply for a Baidu Alliance account. If you are successful, you can place such ads.
How can Baidu Union add couplets to dedecms?
Put the advertisement code in the head file or foot file in the template, so that the whole site can be displayed