
<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 = "URL_banner_0"; link[0] = "URL_link_0"; ban[1] = new Image(); ban[1].src = "URL_banner_1"; link[1] = "URL_link_1"; ban[2] = new Image(); ban[2].src = "URL_banner_2"; link[2] = "URL_link_2"; 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()',3000); } function go() {window.open(link[index-1]);} </script> <img id="rotation" style="cursor:pointer;" src="" onclick="go();"/> <script type="text/javascript">rotator();</script>Trong đoạn code trên bạn lần lượt thay thế URL_banner tương ứng với URL_link.
Chú ý số 3000 ám chỉ 3000 mili giây, tương đương 3 giây chỉ khoảng cách giữa các lần chuyển banner. Bạn có thể điều chỉnh con số này tùy ý.



Bình luận trên Facebook 0 nhận xét
Cám ơn đã ghé thăm blog
Vui lòng để lại ý kiến cho blog
Cám ơn