$(function() {
$("table.section thead").click(function() {
if ($(this).next("table.section tbody").style.display == "block"){
$(this).next("table.section tbody").slideUp("slow");
}
if ($(this).next("table.section tbody").style.display == "none"){
$(this).next("table.section tbody").slideDown("slow");
}
});
});
我不知道如何實現這一點,任何幫助將非常感激。這個Jquery函數有什麼問題,幫助
更新:
我正在嘗試使用以下函數。
$(function() {
$("table.section thead").click(function() {
$(this).next("table.section tbody").slideToggle("slow");
});
});
它給了我一個問題,(THEAD當它崩潰,你點擊它,它擴大,然後再次崩潰,所以這將永遠是崩潰)。這就是爲什麼我試圖讓頂部的功能。
你想達到什麼樣的? – 2010-03-10 11:17:35
我想單擊事件到所有「table.section thead」,所以當它的點擊隱藏了表格的tbody。 – Amra 2010-03-10 11:21:16