- Bạn phải chuẩn bị trước 1 file hình có kích thước tương tự như hình bên dưới:

- Download file
ads.rar ( 1.54K )
Number of downloads: 121 về giải nén và upload lên host gồm 2 file
ads.css và
ads.js, sau đó tiền hành làm theo các bước sau:
1. Chèn đoạn này sau thẻ
<body>HTML
<script src="ads.js" type="text/javascript"></script>
<link href="ads.css" type="text/css" rel="stylesheet">
<map name=FPMap0><AREA onclick=moveback() shape=RECT coords=0,0,250,96 href="#"></map>
+ Chú ý đường dẫn của file
ads.css và
ads.js.
2. Thêm đoạn mã sau trước thẻ
</body>:
CODE
<script language="JavaScript" type="text/javascript">
var exp = 60;
function newCookie(name,value,seconds) {
if (seconds) {
var date = new Date();
date.setTime(date.getTime()+(seconds*1000));
var expires = "; expires="+date.toGMTString(); }
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/"; }
function readCookie(name) {
var nameSG = name + "=";
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameSG) == 0) return c.substring(nameSG.length,c.length); }
return null; }
var num = readCookie('sancookie1')
if (num < 1) {
newCookie('sancookie1','testcookie1', exp);
//alert('Vnpower.org');
// Show Ads
document.write('<div id="flyad"><div id="f1"></div><div id="f2">');
document.write('<img border="0" src="special-a.gif" usemap="#FPMap0" width="250" height="96">');
document.write('<div id="f3"></div></div></div>');
}
else {
document.write('<div id="flyad"><div id="f1"></div><div id="f2">');
document.write('<div id="f3"></div></div></div>');
}
</script>
+ Chú ý đường dẫn của file
special-a.gif.
3. Mở file
ads.js tìm và thay thế cho phù hợp đường dẫn
http://www.vnpower.org/ads.php?id=1+ Bạn cũng có thể chỉnh thời gian hiện quảng cáo trong file
ads.js, bạn tự chỉnh nhé.
Chúc bạn thành công!