亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

關于else問題

<!doctype?html>
<html>
<head>
????<meta?charset="UTF-8">
????<title>頂部廣告展開收起</title>
????<style>
????????body,?div,?img,?span?{
????????????margin:?0;
????????????padding:?0;
????????}
????????#content?{
????????????width:?960px;
????????????height:?1000px;
????????????background:?#ccc;
????????????margin:?0?auto;
????????}
????????#ad?{
????????????width:?960px;
????????????margin:?0?auto;
????????????display:?none;
????????????position:?relative;
????????????overflow:?hidden;
????????}
????????#close?{
????????????position:?absolute;
????????????width:?20px;
????????????height:?20px;
????????????text-align:?center;
????????????line-height:?20px;
????????????background:?#CF3;
????????????top:?0;
????????????right:?0;
????????????display:?none;
????????????cursor:?pointer;
????????}
????</style>
</head>
<body>
<div?id="ad">
????<img?id="adcon"?src="ad.png"?width="960"?height="385"/>
</div>
<div?id="content"><img?src="數字商品-10-23.jpg"?/></div>
<script>
????var?$?=?function(id){
????????return?document.getElementById(id);
????};
????var?oAd?=?$("ad");
????var?oAdcon?=$("adcon");
????var?h?=?0;
????var?maxH?=?oAdcon.height;
????function?adDown(){
????????if(h<maxH){
????????????h+=5;
????????????oAd.style.height?=?h+"px";
????????????oAd.style.display?=?"block";
????????????setTimeout(adDown,10)
????????}else{
????????????oAd.style.height?=?h+"px";
????????????oAd.style.display?=?"block";
????????}
????}
????setTimeout(adDown,3000)
</script>
</body>
</html>


我想問一下,else加不加沒什么變化。為什么要加進去?


正在回答

1 回答

看了下一節,知道他的原因了

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
網頁廣告特效
  • 參與學習       40172    人
  • 解答問題       132    個

原來這么EASY,從淺到深,逐步優化代碼,讓你深入理解

進入課程

關于else問題

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號