$(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