国产99久久精品_欧美日本韩国一区二区_激情小说综合网_欧美一级二级视频_午夜av电影_日本久久精品视频

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當(dāng)前位置: 首頁 - 科技 - 知識百科 - 正文

在javascript中如何實(shí)現(xiàn)循環(huán)廣告條

來源:懂視網(wǎng) 責(zé)編:小OO 時間:2020-11-27 19:36:01
文檔

在javascript中如何實(shí)現(xiàn)循環(huán)廣告條

本文實(shí)例為大家分享了javascript實(shí)現(xiàn)循環(huán)廣告條的具體代碼,供大家參考,具體內(nèi)容如下:html代碼。<;<。DOCTYPE html>;<;html>;<;head>;<;title>;Rotating Banner<;/title>;<;script src=";script07.js";>;<;/script>;<;link rel=";stylesheet";href=";script01.css";rel=";external nofollow";>;<;/head>;<;body>;<;p class="。
推薦度:
導(dǎo)讀本文實(shí)例為大家分享了javascript實(shí)現(xiàn)循環(huán)廣告條的具體代碼,供大家參考,具體內(nèi)容如下:html代碼。<;<。DOCTYPE html>;<;html>;<;head>;<;title>;Rotating Banner<;/title>;<;script src=";script07.js";>;<;/script>;<;link rel=";stylesheet";href=";script01.css";rel=";external nofollow";>;<;/head>;<;body>;<;p class="。

這篇文章主要為大家詳細(xì)介紹了javascript實(shí)現(xiàn)循環(huán)廣告條效果,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了javascript實(shí)現(xiàn)循環(huán)廣告條的具體代碼,供大家參考,具體內(nèi)容如下

html代碼:

<!DOCTYPE html>
<html>
<head>
<title>Rotating Banner</title>
<script src="script07.js"></script>
<link rel="stylesheet" href="script01.css" rel="external nofollow" >
</head>
<body>
<p class="centered">
<img src="images/reading1.gif" id="adBanner" alt="Ad Banner">
</p>
</body>
</html>

css代碼:

body {
background-color: white;
color: black;
font-size: 20px;
font-family: "Lucida Grande", Verdana,Arial, Helvetica, sans-serif;
}
h1, th {
font-family: Georgia, "Times New Roman",Times, serif;
}
h1 {
font-size: 28px;
}
table {
border-collapse: collapse;
}
th, td {
padding: 10px;
border: 2px #666 solid;
text-align: center;
width: 20%;
}
#free, .pickedBG {
background-color: #f66;
}
.winningBG {
background-image:url(images/redFlash.gif);
}

js代碼:

window.onload = rotate;
var thisAd = 0;
function rotate() {
var adImages = new Array("images/ reading1.gif","images/reading2. gif","images/reading3.gif");
thisAd++;
if (thisAd == adImages.length) {
thisAd = 0;
}
document.getElementById("adBanner").src = adImages[thisAd];
setTimeout(rotate, 3 * 1000);//設(shè)置時間,本每隔多長時間改變廣告條中的GIF
}

在循環(huán)廣告條中添加鏈接:修改js的代碼

window.onload = initBannerLink;
var thisAd = 0;
function initBannerLink() {
if (document.getElementById("adBanner").parentNode.tagName == "A") {
document.getElementById("adBanner").parentNode.onclick = newLocation;
}
rotate();
}
function newLocation() {
var adURL = new Array("negrino.com","sun.com","microsoft.com");
document.location.href = "http://www." + adURL[thisAd];
return false;
}
function rotate() {
var adImages = new Array("images/ reading1.gif","images/reading2. gif","images/reading3.gif");
thisAd++;
if (thisAd == adImages.length) {
thisAd = 0;
}
document.getElementById("adBanner").src = adImages[thisAd];
setTimeout(rotate, 3 * 1000);//設(shè)置時間,本每隔多長時間改變廣告條中的GIF
}

上面是我整理給大家的,希望今后會對大家有幫助。

相關(guān)文章:

如何利用滾動條位置判斷

使用微信小程序如何實(shí)現(xiàn)動態(tài)設(shè)置placeholder提示文字

有關(guān)ES6/JavaScript使用技巧(詳細(xì)教程)

在nodejs中如何實(shí)現(xiàn)爬取網(wǎng)站圖片

聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

在javascript中如何實(shí)現(xiàn)循環(huán)廣告條

本文實(shí)例為大家分享了javascript實(shí)現(xiàn)循環(huán)廣告條的具體代碼,供大家參考,具體內(nèi)容如下:html代碼。<;<。DOCTYPE html>;<;html>;<;head>;<;title>;Rotating Banner<;/title>;<;script src=";script07.js";>;<;/script>;<;link rel=";stylesheet";href=";script01.css";rel=";external nofollow";>;<;/head>;<;body>;<;p class="。
推薦度:
  • 熱門焦點(diǎn)

最新推薦

猜你喜歡

熱門推薦

專題
Top
主站蜘蛛池模板: 在线播放真实国产乱子伦 | 日韩欧美在线不卡 | 人与鲁牲交持级毛片 | 欧美高清视频在线 | 精品一区二区三区在线成人 | 中文字幕有码在线播放 | 视频一区二区三区在线 | 国产成人精品亚洲一区 | 国产精品亚洲精品日韩动图 | 亚洲精品视频在线观看免费 | 欧美二区三区 | 久久久久国产一级毛片高清版 | 福利视频一区二区牛牛 | 久久久一区二区三区 | 日韩精品免费观看 | 国产二区视频 | 一区精品麻豆经典 | 可播放的免费男男videos不卡 | 日本黄 色 成 年 人免费观看 | 97伊人网 | 九九久久香港经典三级精品 | 五月天婷婷视频在线观看 | 中文字幕日韩有码 | 亚洲乱码一二三四区麻豆 | 一级毛片私人影院免费 | 国产精品v一区二区三区 | 国产在线精品观看一区 | 国产自在自线午夜精品视频 | 国产福利视精品永久免费 | 精品久久成人 | 狂野欧美老黑粗又硬 | 福利国产 | 精品日本一区二区三区在线观看 | 国产高清视频在线观看 | 韩国精品一区二区久久 | 91原创国产| 日本欧美另类 | 国产精品一区久久 | 久久精品99久久香蕉国产色戒 | 国产 欧美 日韩 在线 | 欧美日韩精品在线观看 |