Sau đây Thế Giới Blog xin chia sẻ với các bạn : Code chèn popup quảng cáo ở góc phải - góc trái màn hình web các bạn thực hiện theo các bước sau:
Chú ý các bạn thay các mục sau cho hợp lý
- http://thegioiblogs.blogspot.com/: Link fanpage của bạn
- width=250 : Chiều rộng khung
- height=200: Chiều cao khung
- Phần link ảnh tronng phần <img src="...." /> các bạn thay bằng link ảnh của các bạn nhé
Code chèn popup quảng cáo ở góc phải màn hình cho website - Blogspot
1. Đối với Blogspot:
Bước 1: Đăng nhập blogspot ==> Bố Cục ==> Thêm tiện ích ==> HTML/Javascript rồi copy đoạn code dưới đây vào
<script type="text/javascript">
function hide_float_right() {
var content = document.getElementById('float_content_right');
var hide = document.getElementById('hide_float_right');
if (content.style.display == "none")
{content.style.display = "block"; hide.innerHTML = '<a href="javascript:hide_float_right()">Tắt quảng cáo [X]</a>'; }
else { content.style.display = "none"; hide.innerHTML = '<a href="javascript:hide_float_right()">Xem quảng cáo...</a>';
}
}
</script>
<style>
.float-ck { position: fixed; bottom: 0px; z-index: 9000}
* html .float-ck {position:absolute;bottom:auto;top:expression(eval (document.documentElement.scrollTop+document.docum entElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0))) ;}
#float_content_right {border: 1px solid #01AEF0;}
#hide_float_right {text-align:right; font-size: 11px;}
#hide_float_right a {background: #01AEF0; padding: 2px 4px; color: #FFF;}
</style>
<div class="float-ck" style="right: 0px" >
<div id="hide_float_right">
<a href="javascript:hide_float_right()">Tắt Quảng Cáo [X]</a></div>
<div id="float_content_right">
<!-- Start quang cao-->
<a href="http://thegioiblogs.blogspot.com/" taget="_blank" ><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh01kgA8YA6m8ULXpB7UbwLS9VWADNeuGM69YJ5NkRTQyDQ0n033l1c3o9BiKvx9EbM7-bAcbIIW9rGFhW-e2K828uwIlZJ_eKP7u4XUQpzZj8iFKyciDIj9CSHOiI0cX6cFldfs4N_BCc/s1600/idc.gif" width="250" height="200"></a>
<!-- End quang cao -->
</div>
</div>
function hide_float_right() {
var content = document.getElementById('float_content_right');
var hide = document.getElementById('hide_float_right');
if (content.style.display == "none")
{content.style.display = "block"; hide.innerHTML = '<a href="javascript:hide_float_right()">Tắt quảng cáo [X]</a>'; }
else { content.style.display = "none"; hide.innerHTML = '<a href="javascript:hide_float_right()">Xem quảng cáo...</a>';
}
}
</script>
<style>
.float-ck { position: fixed; bottom: 0px; z-index: 9000}
* html .float-ck {position:absolute;bottom:auto;top:expression(eval (document.documentElement.scrollTop+document.docum entElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0))) ;}
#float_content_right {border: 1px solid #01AEF0;}
#hide_float_right {text-align:right; font-size: 11px;}
#hide_float_right a {background: #01AEF0; padding: 2px 4px; color: #FFF;}
</style>
<div class="float-ck" style="right: 0px" >
<div id="hide_float_right">
<a href="javascript:hide_float_right()">Tắt Quảng Cáo [X]</a></div>
<div id="float_content_right">
<!-- Start quang cao-->
<a href="http://thegioiblogs.blogspot.com/" taget="_blank" ><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh01kgA8YA6m8ULXpB7UbwLS9VWADNeuGM69YJ5NkRTQyDQ0n033l1c3o9BiKvx9EbM7-bAcbIIW9rGFhW-e2K828uwIlZJ_eKP7u4XUQpzZj8iFKyciDIj9CSHOiI0cX6cFldfs4N_BCc/s1600/idc.gif" width="250" height="200"></a>
<!-- End quang cao -->
</div>
</div>
2. Đối với website
Bạn thêm đoạn code sau lên trên thẻ đóng </body>
<script type="text/javascript">
function hide_float_right() {
var content = document.getElementById('float_content_right');
var hide = document.getElementById('hide_float_right');
if (content.style.display == "none")
{content.style.display = "block"; hide.innerHTML = '<a href="javascript:hide_float_right()">Tắt quảng cáo [X]</a>'; }
else { content.style.display = "none"; hide.innerHTML = '<a href="javascript:hide_float_right()">Xem quảng cáo...</a>';
}
}
</script>
<style>
.float-ck { position: fixed; bottom: 0px; z-index: 9000}
* html .float-ck {position:absolute;bottom:auto;top:expression(eval (document.documentElement.scrollTop+document.docum entElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0))) ;}
#float_content_right {border: 1px solid #01AEF0;}
#hide_float_right {text-align:right; font-size: 11px;}
#hide_float_right a {background: #01AEF0; padding: 2px 4px; color: #FFF;}
</style>
<div class="float-ck" style="right: 0px" >
<div id="hide_float_right">
<a href="javascript:hide_float_right()">Tắt Quảng Cáo [X]</a></div>
<div id="float_content_right">
<!-- Start quang cao-->
<a href="http://thegioiblogs.blogspot.com/" taget="_blank" ><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh01kgA8YA6m8ULXpB7UbwLS9VWADNeuGM69YJ5NkRTQyDQ0n033l1c3o9BiKvx9EbM7-bAcbIIW9rGFhW-e2K828uwIlZJ_eKP7u4XUQpzZj8iFKyciDIj9CSHOiI0cX6cFldfs4N_BCc/s1600/idc.gif" width="250" height="200"></a>
<!-- End quang cao -->
</div>
</div>
function hide_float_right() {
var content = document.getElementById('float_content_right');
var hide = document.getElementById('hide_float_right');
if (content.style.display == "none")
{content.style.display = "block"; hide.innerHTML = '<a href="javascript:hide_float_right()">Tắt quảng cáo [X]</a>'; }
else { content.style.display = "none"; hide.innerHTML = '<a href="javascript:hide_float_right()">Xem quảng cáo...</a>';
}
}
</script>
<style>
.float-ck { position: fixed; bottom: 0px; z-index: 9000}
* html .float-ck {position:absolute;bottom:auto;top:expression(eval (document.documentElement.scrollTop+document.docum entElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0))) ;}
#float_content_right {border: 1px solid #01AEF0;}
#hide_float_right {text-align:right; font-size: 11px;}
#hide_float_right a {background: #01AEF0; padding: 2px 4px; color: #FFF;}
</style>
<div class="float-ck" style="right: 0px" >
<div id="hide_float_right">
<a href="javascript:hide_float_right()">Tắt Quảng Cáo [X]</a></div>
<div id="float_content_right">
<!-- Start quang cao-->
<a href="http://thegioiblogs.blogspot.com/" taget="_blank" ><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh01kgA8YA6m8ULXpB7UbwLS9VWADNeuGM69YJ5NkRTQyDQ0n033l1c3o9BiKvx9EbM7-bAcbIIW9rGFhW-e2K828uwIlZJ_eKP7u4XUQpzZj8iFKyciDIj9CSHOiI0cX6cFldfs4N_BCc/s1600/idc.gif" width="250" height="200"></a>
<!-- End quang cao -->
</div>
</div>
Code chèn popup quảng cáo ở góc trái màn hình cho website - Blogspot
1. Đối với Blogspot:
Bước 1: Đăng nhập blogspot ==> Bố Cục ==> Thêm tiện ích ==> HTML/Javascript rồi copy đoạn code dưới đây vào
<script type="text/javascript">
function hide_float_left() {
var content = document.getElementById('float_content_left');
var hide = document.getElementById('hide_float_left');
if (content.style.display == "none")
{content.style.display = "block"; hide.innerHTML = '<a href="javascript:hide_float_left()">Tắt quảng cáo [X]</a>'; }
else { content.style.display = "none"; hide.innerHTML = '<a href="javascript:hide_float_left()">Xem quảng cáo...</a>';
}
}
</script>
<style>
.float-ck { position: fixed; bottom: 0px; z-index: 9000}
* html .float-ck {position:absolute;bottom:auto;top:expression(eval (document.documentElement.scrollTop+document.docum entElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0))) ;}
#float_content_left {border: 1px solid #01AEF0;}
#hide_float_left {text-align:left; font-size: 11px;}
#hide_float_left a {background: #01AEF0; padding: 2px 4px; color: #FFF;}
</style>
<div class="float-ck" style="left: 0px" >
<div id="hide_float_left">
<a href="javascript:hide_float_left()">Tắt Quảng Cáo [X]</a></div>
<div id="float_content_left">
<!-- Start quang cao-->
<a href="http://thegioiblogs.blogspot.com/" taget="_blank" ><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh01kgA8YA6m8ULXpB7UbwLS9VWADNeuGM69YJ5NkRTQyDQ0n033l1c3o9BiKvx9EbM7-bAcbIIW9rGFhW-e2K828uwIlZJ_eKP7u4XUQpzZj8iFKyciDIj9CSHOiI0cX6cFldfs4N_BCc/s1600/idc.gif" width="250" height="200"></a>
<!-- End quang cao -->
</div>
</div>
function hide_float_left() {
var content = document.getElementById('float_content_left');
var hide = document.getElementById('hide_float_left');
if (content.style.display == "none")
{content.style.display = "block"; hide.innerHTML = '<a href="javascript:hide_float_left()">Tắt quảng cáo [X]</a>'; }
else { content.style.display = "none"; hide.innerHTML = '<a href="javascript:hide_float_left()">Xem quảng cáo...</a>';
}
}
</script>
<style>
.float-ck { position: fixed; bottom: 0px; z-index: 9000}
* html .float-ck {position:absolute;bottom:auto;top:expression(eval (document.documentElement.scrollTop+document.docum entElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0))) ;}
#float_content_left {border: 1px solid #01AEF0;}
#hide_float_left {text-align:left; font-size: 11px;}
#hide_float_left a {background: #01AEF0; padding: 2px 4px; color: #FFF;}
</style>
<div class="float-ck" style="left: 0px" >
<div id="hide_float_left">
<a href="javascript:hide_float_left()">Tắt Quảng Cáo [X]</a></div>
<div id="float_content_left">
<!-- Start quang cao-->
<a href="http://thegioiblogs.blogspot.com/" taget="_blank" ><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh01kgA8YA6m8ULXpB7UbwLS9VWADNeuGM69YJ5NkRTQyDQ0n033l1c3o9BiKvx9EbM7-bAcbIIW9rGFhW-e2K828uwIlZJ_eKP7u4XUQpzZj8iFKyciDIj9CSHOiI0cX6cFldfs4N_BCc/s1600/idc.gif" width="250" height="200"></a>
<!-- End quang cao -->
</div>
</div>
2. Đối với website
Bạn thêm đoạn code sau lên trên thẻ đóng </body>
<script type="text/javascript">
function hide_float_left() {
var content = document.getElementById('float_content_left');
var hide = document.getElementById('hide_float_left');
if (content.style.display == "none")
{content.style.display = "block"; hide.innerHTML = '<a href="javascript:hide_float_left()">Tắt quảng cáo [X]</a>'; }
else { content.style.display = "none"; hide.innerHTML = '<a href="javascript:hide_float_left()">Xem quảng cáo...</a>';
}
}
</script>
<style>
.float-ck { position: fixed; bottom: 0px; z-index: 9000}
* html .float-ck {position:absolute;bottom:auto;top:expression(eval (document.documentElement.scrollTop+document.docum entElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0))) ;}
#float_content_left {border: 1px solid #01AEF0;}
#hide_float_left {text-align:left; font-size: 11px;}
#hide_float_left a {background: #01AEF0; padding: 2px 4px; color: #FFF;}
</style>
<div class="float-ck" style="left: 0px" >
<div id="hide_float_left">
<a href="javascript:hide_float_left()">Tắt Quảng Cáo [X]</a></div>
<div id="float_content_left">
<!-- Start quang cao-->
<a href="http://thegioiblogs.blogspot.com/" taget="_blank" ><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh01kgA8YA6m8ULXpB7UbwLS9VWADNeuGM69YJ5NkRTQyDQ0n033l1c3o9BiKvx9EbM7-bAcbIIW9rGFhW-e2K828uwIlZJ_eKP7u4XUQpzZj8iFKyciDIj9CSHOiI0cX6cFldfs4N_BCc/s1600/idc.gif" width="250" height="200"></a>
<!-- End quang cao -->
</div>
</div>
function hide_float_left() {
var content = document.getElementById('float_content_left');
var hide = document.getElementById('hide_float_left');
if (content.style.display == "none")
{content.style.display = "block"; hide.innerHTML = '<a href="javascript:hide_float_left()">Tắt quảng cáo [X]</a>'; }
else { content.style.display = "none"; hide.innerHTML = '<a href="javascript:hide_float_left()">Xem quảng cáo...</a>';
}
}
</script>
<style>
.float-ck { position: fixed; bottom: 0px; z-index: 9000}
* html .float-ck {position:absolute;bottom:auto;top:expression(eval (document.documentElement.scrollTop+document.docum entElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0))) ;}
#float_content_left {border: 1px solid #01AEF0;}
#hide_float_left {text-align:left; font-size: 11px;}
#hide_float_left a {background: #01AEF0; padding: 2px 4px; color: #FFF;}
</style>
<div class="float-ck" style="left: 0px" >
<div id="hide_float_left">
<a href="javascript:hide_float_left()">Tắt Quảng Cáo [X]</a></div>
<div id="float_content_left">
<!-- Start quang cao-->
<a href="http://thegioiblogs.blogspot.com/" taget="_blank" ><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh01kgA8YA6m8ULXpB7UbwLS9VWADNeuGM69YJ5NkRTQyDQ0n033l1c3o9BiKvx9EbM7-bAcbIIW9rGFhW-e2K828uwIlZJ_eKP7u4XUQpzZj8iFKyciDIj9CSHOiI0cX6cFldfs4N_BCc/s1600/idc.gif" width="250" height="200"></a>
<!-- End quang cao -->
</div>
</div>
Chúc các bạn thành công !
No comments :