<p class="slide">
<a href="javascript:showdiv();" id="strHref" class="btn-slide" >展開</a> <!--點(diǎn)擊按鈕-->
</p>
<a href="javascript:showdiv();" id="strHref" class="btn-slide" >展開</a> <!--點(diǎn)擊按鈕-->
</p>
2016-02-22
function hidediv() {//收起函數(shù)
document.getElementById('hpn').style.display='none';
document.getElementById("strHref").href="javascript:showdiv();";
}
document.getElementById('hpn').style.display='none';
document.getElementById("strHref").href="javascript:showdiv();";
}
2016-02-22
function showdiv() {//展開函數(shù)
document.getElementById('hpn').style.display='block';
document.getElementById('strHref').innerHTML='收起-';
document.getElementById("strHref").href="javascript:hidediv();";
}
document.getElementById('hpn').style.display='block';
document.getElementById('strHref').innerHTML='收起-';
document.getElementById("strHref").href="javascript:hidediv();";
}
2016-02-22
最贊回答 / BCS
?1.8 版本棄用的 API ? 不過你可以使用其他方法代替?<...code...>
var h=0;
function addh() {
if(h<300) {
h+=5;
document.getElementById("pn").style.height=h+"px";
}
else{
return;
}
setTimeout("addh()",30);
}
function addh() {
if(h<300) {
h+=5;
document.getElementById("pn").style.height=h+"px";
}
else{
return;
}
setTimeout("addh()",30);
}
2016-02-17
已采納回答 / 飛天意大利面神獸
<...code...>所以p元素會擁有margin值,而margin是外擴(kuò)充。元素的任何內(nèi)容都會被margin所包裹,包括background,所以你會看到有空隙,但margin也屬于那個元素本身,所以其實(shí)本身是已經(jīng)觸頂?shù)摹6鴓adding是內(nèi)擴(kuò)充,相當(dāng)于有棍子把容器給撐開了,然后background繼續(xù)覆蓋,所以令你感覺上padding值加上了,然后就觸頂了。
2016-02-01
最新回答 / 飛天意大利面神獸
HBuilder,有一個功能可以自動規(guī)范化,編輯——整理代碼格式,快捷鍵,ctrl+shift+f.HBuilder比老師用的visual studio在編程web語言上要好用。VS主要在功能上非常強(qiáng)大,可以編程市面上所有你用到的包括安卓/ios/windows m,win32 , uwp ,asp網(wǎng)站等等,各種軟件/網(wǎng)站。另外,目前visual studio2015對于個體開發(fā)者是完全免費(fèi)。
2016-02-01
后來我復(fù)制別人的筆記,我才發(fā)現(xiàn)原來是不用$(document).ready這部分不要就可以了。
2016-01-28
<a href="#"></a>中的 href="javascript:;";就可以了。
2016-01-23