Social Icon

twitterfacebookgoogle pluslinkedinrss feedemail

Thứ Ba, 18 tháng 6, 2013

Code chèn quảng cáo ở góc phải của trang


Code chèn quảng cáo ở góc phải của trang


Khi các bạn vào một số website thấy có một mẫu quảng cáo xuất hiện ở góc dưới bên phải của trang. 

standard banner
Chuẩn bị bán quảng cáo kiếm tiền nuôi hosting và domain nên cũng tìm hiểu chút về cách chèn loại hình quảng cáo này vào website. Dưới đây là đoạn code do các bạn bên sinhvienit.net share. OnlineSeeding xin chia sẻ lại cùng các bạn.
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<script type="text/javascript">
//Alert MsgAd
clicksor_enable_MsgAlert = true;
//default pop-under house ad url
clicksor_enable_pop = true; clicksor_frequencyCap = 0.1;
durl = '';
//default banner house ad url
clicksor_default_url = '';
clicksor_banner_border = '#000f30'; clicksor_banner_ad_bg = '#FFFFFF';
clicksor_banner_link_color = '#0c15ff'; clicksor_banner_text_color = '#da0041';
clicksor_banner_image_banner = true; clicksor_banner_text_banner = true;
clicksor_layer_border_color = '';
clicksor_layer_ad_bg = ''; clicksor_layer_ad_link_color = '';
clicksor_layer_ad_text_color = ''; clicksor_text_link_bg = '';
clicksor_text_link_color = '#0c59ff'; clicksor_enable_text_link = true;
clicksor_enable_VideoAd = true;
</script>
<style type="text/css">
* html div#fl813691 {position: absolute; overflow:hidden;
top:expression(eval(document.compatMode &&
document.compatMode=='CSS1Compat') ?
documentElement.scrollTop
+(documentElement.clientHeight-this.clientHeight)
: document.body.scrollTop
+(document.body.clientHeight-this.clientHeight));}
#fl813691{font: 12px Arial, Helvetica, sans-serif; color:#666; position:fixed; _position: absolute; right:0; bottom:0; height:150px; }
#eb951855{ width:189px; padding-right:7px; background:url(https://lh5.googleusercontent.com/-tC1Af6p9aw8/UEuOWQws00I/AAAAAAAAa-g/BbHcKKr5plc/s0/fullborder_bg_right.gif) no-repeat right top;}
#cob263512{background:url(https://lh4.googleusercontent.com/-ClNrLnNnkOc/UEuOWLuYZ1I/AAAAAAAAa-k/FTBzIb2RH7E/s0/fullborder_bg.gif) no-repeat left top; height:150px; padding-left:7px;}
#coh963846{color:#690;display:block; height:20px; line-height:20px; font-size:11px; width:183px;}
#coh963846 a{color:#690;text-decoration:none;}
#coc67178{float:right; padding:0; margin:0; list-style:none; overflow:hidden; height:15px;}
            #coc67178 li{display:inline;}
            #coc67178 li a{background-image:url(https://lh6.googleusercontent.com/-GndSGSlTOiY/UEuOWHOL_3I/AAAAAAAAa-c/duzdTEwLvK0/s0/button.gif); background-repeat:no-repeat; width:30px; height:0; padding-top:15px; overflow:hidden; float:left;}
                #coc67178 li a.close{background-position: 0 0;}
                #coc67178 li a.close:hover{background-position: 0 -15px;}
                #coc67178 li a.min{background-position: -30px 0;}
                #coc67178 li a.min:hover{background-position: -30px -15px;}
                #coc67178 li a.max{background-position: -60px 0;}
                #coc67178 li a.max:hover{background-position: -60px -15px;}
#co453569{display:block; margin:0; padding:0; height:123px;  border-style:solid; border-width:1px; border-color:#111 #999 #999 #111; line-height:1.6em; overflow:hidden;}
</style>
 <div style="height: 152px;" id="fl813691">
    <div id="eb951855">
    <div id="cob263512">
        <div id="coh963846">
            <ul id="coc67178">
                <li id="pf204652hide"><a class="min" href="javascript:pf204652clickhide();" title="Ẩn cửa sổ này">Ẩn cửa sổ này</a></li>
                <li id="pf204652show" style="display: none;"><a class="max" href="javascript:pf204652clickshow();" title="Mở cửa sổ này">Mở cửa sổ này</a></li>
                <li id="pf204652close"><a class="close" href="javascript:pf204652clickclose();" title="Tắt cửa sổ này">Tắt cửa sổ này</a></li>
            </ul>
         Tên quảng cáo
       </div>
        <div id="co453569">Quảng cáo<br>(width="180" height="133")<br><a target="_blank" href="http://www.onlineseeding.vn/">OnlineSeeding.vn - Click Here</a></div>
    </div></div></div>
<script>
pf204652bottomLayer = document.getElementById('fl813691');
var pf204652IntervalId = 0;
var pf204652maxHeight = 150;
var pf204652minHeight = 20;
var pf204652curHeight = 0;
function pf204652show( ){
  pf204652curHeight += 2;
  if (pf204652curHeight > pf204652maxHeight){
    clearInterval ( pf204652IntervalId );
  }
  pf204652bottomLayer.style.height = pf204652curHeight+'px';
}
function pf204652hide( ){
  pf204652curHeight -= 3;
  if (pf204652curHeight < pf204652minHeight){
    clearInterval ( pf204652IntervalId );
  }
  pf204652bottomLayer.style.height = pf204652curHeight+'px';
}
pf204652IntervalId = setInterval ( 'pf204652show()', 5 );
function pf204652clickhide(){
    document.getElementById('pf204652hide').style.display='none';
    document.getElementById('pf204652show').style.display='inline';
    pf204652IntervalId = setInterval ( 'pf204652hide()', 5 );
}
function pf204652clickshow(){
    document.getElementById('pf204652hide').style.display='inline';
    document.getElementById('pf204652show').style.display='none';
    pf204652IntervalId = setInterval ( 'pf204652show()', 5 );
}
function pf204652clickclose(){
    document.body.style.marginBottom = '0px';
    pf204652bottomLayer.style.display = 'none';
}
</script>
Rating: 4.3/5 (6 votes cast)
Code này bạn có thể chèn vào header, footer hoặc sidebar bạn nhé.

3 nhận xét:

  1. Nếu em xài blog miễn phí của wordpress thì không chạy được script em ạ. Còn nếu blog em chạy được script thì em có thể chèn vào widget. Hoặc chỗ nào em muốn slide hiển thị.

    Trả lờiXóa
  2. Ồ vậy thì em muốn quảng cáo hiện ở chỗ nào thì chèn code vào đó thôi. Thường thì đặt ở sidebar thì mình sẽ tạo một widget Text trên sidebar rồi add code vào.

    Trả lờiXóa
  3. Cái này có dùng cho blogspot được không anh ơi?
    Được bạn ạ, bạn vào chỉnh sửa bố cục rồi thêm tiện ích HTML/Javascript vào vị trí bạn muốn hiển thị quảng cáo. Sau đó paste code bên trên vào nhé.

    Trả lờiXóa

 

Tổng số lượt xem trang

See You Again

Hẹn gặp lại bạn và chúc bạn có một ngày thật vui - hạnh phúc