第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定

頂部廣告,代碼有問題嗎?

為何我將ID放在注釋一的位置,就不能成功?

正在回答

4 回答

<div?id="ad">?
???<img?id="adcon"?src="ad.png"?width="960"?height="385"/>?
</div>
<div?id="content"><img?src="數(shù)字商品-10-23.jpg"?/></div>
<script>
//全局變量
var?oAd?????=?document.getElementById('ad');
var?oAdcon??=?document.getElementById('adcon');
var?h?=?0;
var?step?=?5;
var?maxH?=?oAdcon.height;
function?adDown(){
oAd.style.height?=?h?+'px';
????oAd.style.display?=?'block';
if(h<maxH){
h+=step;
setTimeout(adDown,1);
}else{
setTimeout(adUp,3000);
}
}
function?adUp(){
if(h>0){
h-=step;
oAd.style.height?=?h?+'px';
setTimeout(adUp,1);
}
}
setTimeout(adDown,3000);
</script>


0 回復(fù) 有任何疑惑可以回復(fù)我~

<div?id="ad">?

???<img?id="adcon"?src="ad.png"?width="960"?height="385"/>?

</div>

<div?id="content"><img?src="數(shù)字商品-10-23.jpg"?/></div>

<script>

//全局變量

var?oAd?????=?document.getElementById('ad');

var?oAdcon??=?document.getElementById('adcon');

var?h?=?0;

var?step?=?5;

var?maxH?=?oAdcon.height;

function?adDown(){

oAd.style.height?=?h?+'px';

????oAd.style.display?=?'block';

if(h<maxH){

h+=step;

setTimeout(adDown,1);

}else{

setTimeout(adUp,3000);

}

}

function?adUp(){

if(h>0){

h-=step;

oAd.style.height?=?h?+'px';

setTimeout(adUp,1);

}

}

setTimeout(adDown,3000);

</script>


0 回復(fù) 有任何疑惑可以回復(fù)我~
<div?id="ad">?
???<img?id="adcon"?src="ad.png"?width="960"?height="385"/>?
</div>
<div?id="content"><img?src="數(shù)字商品-10-23.jpg"?/></div>
<script>
//全局變量
var?oAd?????=?document.getElementById('ad');
var?oAdcon??=?document.getElementById('adcon');
var?h?=?0;
var?step?=?5;
var?maxH?=?oAdcon.height;
function?adDown(){
oAd.style.height?=?h?+'px';
????oAd.style.display?=?'block';
if(h<maxH){
h+=step;
setTimeout(adDown,1);
}else{
setTimeout(adUp,3000);
}
}
function?adUp(){
if(h>0){
h-=step;
oAd.style.height?=?h?+'px';
setTimeout(adUp,1);
}
}
setTimeout(adDown,3000);
</script>

還有個(gè)小問題,這是另一段代碼,script中依然是外邊全局,但這個(gè)是可以執(zhí)行成功的???



0 回復(fù) 有任何疑惑可以回復(fù)我~

按照從上而下執(zhí)行的順序,定義pn時(shí)還未能讀取到html文件中id為pn的元素內(nèi)容,所以全局定義pn變量時(shí),pn為空

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

夢身 提問者

謝謝回答,還有個(gè)小問題哈!
2015-07-27 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
展開與收起效果
  • 參與學(xué)習(xí)       33635    人
  • 解答問題       183    個(gè)

通過效果展示與案例分析,教您實(shí)現(xiàn)不同類型的展開與收起效果

進(jìn)入課程

頂部廣告,代碼有問題嗎?

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號