我想知道是否有方法將關閉按鈕(或動作)添加到我正在處理的這個手風琴腳本中。我沒有jquery的知識,但很想學習它。向jQuery Accordion腳本添加關閉按鈕
這裏是我的手風琴代碼:
$(document).ready(function(){
$(".accordion .intro:first").addClass("active");
$(".accordion .more:not(:first)").hide();
$(".accordion .intro").click(function(){
$(this).next(".more").slideToggle("slow")
.siblings(".more:visible").slideUp("slow");
$(this).toggleClass("active");
$(this).siblings(".intro").removeClass("active");
});
});
我想補充一類關門,所以我可以添加內容的按鈕來關閉或.slideUp
感謝。
你已經採取了看看jQueryUI的摺疊菜單?它允許您指定哪些事件會引發手風琴運動。 http://jqueryui.com/demos/accordion/ – awshepard 2010-06-10 20:11:40