0
我有一個非常基本的切換腳本,它工作正常,但我想切換標籤,以便它表明顯示第一則隱藏jQuery的切換標籤/按鈕上的文字
我的HTML是:
<button type="button" class="show">Show</button>
<br />
<br />
<div id="info">#info</div>
<div id="edit">#edit</div>
和我jQuery是
$("#edit").hide();
$(".show").click(function(){
$("#info, #edit").fadeToggle("slow");
});
CSS是:
#info {
position:absolute;
left:0px;
background-color:green;
width:100px;
height:100px;
}
#edit {
position:absolute;
background-color:red;
width:100px;
height:100px;
}
你在哪裏把jQuery代碼,你把它包裝成$(文件)。就緒()? – Stickers
不確定你的意思?內容在第一次加載時隱藏,但你想隱藏它? – Mushr00m
'$(document).ready(){alert('當文檔被完全加載時運行這個代碼')}'。如果你的html元素上面有jQuery代碼,它們還不存在,所以你的jQuery不會執行。 – Xorifelse