Zing News - Tri thức trực tuyến

M

Code Quảng Cáo ở Giữa màn hình

Friday, May 2, 2014

Mã:
<script type="text/javascript">
// Banner Rotation Script by Bloggerism
var ban = new Array();
var link = new Array();
var index = 0;
ban[0] = new Image();
ban[0].src = "http://dalatmuaban.net/hinhanh/backlink-gov.gif";
link[0] = "http://dalatmuaban.net/threads/.88/";

ban[1] = new Image();
ban[1].src = "http://mua.edu.vn/hinhanh/quang-cao.png";
link[1] = "http://mua.edu.vn";

ban[2] = new Image();
ban[2].src = "URL hình ảnh";
link[2] = "URL web";

index = Math.random() * (ban.length);
index = Math.floor(index);
function rotator()
{if (index == ban.length) index = 0;
if (document.images) {
document.images.rotation.src = ban[index].src;
}
else {
document.getElementById('rotation').src=ban[index].src;
}
index++;
setTimeout('rotator()',5000);
}
function go() {window.open(link[index-1]);}
</script>
<img id="rotation" style="cursor:pointer;" src="" onclick="go();"/>
<script type="text/javascript">rotator();</script>
Các bạn chèn code trên vào website nơi muốn hiển thị quảng cáo sau đó chèn link và hình ảnh vào như mẫu trên, thông số 5000 là thông số tương ứng 5000 mili giây = 5s các bạn có thể tùy chỉnh lại nó. Cái này nó tự động nhảy các bạn không cần chỉnh thêm gì nhé.

Chúc các bạn quảng cáo thành công
  • http://thuthuatvinasens.blogspot.com/2014/05/code-quang-cao-o-giua-man-hinh.html
Zing cám ơn bạn đã quan tâm và rất vui vì bài viết đã đem lại thông tin hữu ích cho bạn.

All comments [ 0 ]


Your comments