,而不是我的代碼:製作默認行爲關閉的開放
$("#accordion h3.prof").next().show();
$("#accordion h3").next().hide();
$("h3.first").next().hide();
$("#accordion h3.prof").next().show();
$("#accordion h3").click(function() {
$(this).next().toggle('blind', 500);
});
<div id="accordion">
<h3 class="prof"><a href="#">Title</a></h3>
<div class="closed-box">
Content area that can be hidden
</div>
</div>
它創建了一個盒子觸發/打開關閉效果,當你點擊h3
。事情是,該框始終是默認打開的,我希望只有<div>
的.closed-box
這個類的默認行爲纔會關閉 - 但這只是沒有發生。即使我給風格顯示:沒有.closed-box
有人可以協助嗎?
如果您可以將HTML添加到問題中,或者在http://jsfiddle.net中顯示問題的示例,這將有很大幫助。每種情況下的next()元素是什麼? –