$(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");
}
});
});
私はこれを達成する方法を知りません、どんな助けでも非常にありがたいです。
アップデート:
次の機能を使おうとしていました。
$(function() {
$("table.section thead").click(function() {
$(this).next("table.section tbody").slideToggle("slow");
});
});
それは私に問題を与えます(それが崩壊し、あなたがそれをクリックすると、それは拡大してから再び崩壊するので、それは常に崩壊するでしょう)。そのため、私は関数を一番上に配置しようとしています。