// accordion
$("#left-nav .block h2").click(function(){
$(this).next("div").slideToggle("fast", function() {
alert("hey");
$("#left-nav, #content, #aside").equalHeight();
})
.siblings("div:visible").slideUp("fast");
$(this).toggleClass("active");
$(this).siblings("h2").removeClass("active");
});
$("#left-nav .block h3").toggle(function(){
$(this).next("ul").slideToggle("fast");
$(this).removeClass("active");
}, function() {
$(this).next("ul").slideToggle("fast");
$(this).toggleClass("active");
$(this).siblings("h3").removeClass("active");
});
경고는 작동하지만 열의 크기는 조정되지 않습니다. 다음은 equalHeight 함수입니다.slideToggle 콜백 함수
jQuery.fn.equalHeight=function() {
var maxHeight=0;
this.each(function(){
if (this.offsetHeight>maxHeight) {maxHeight=this.offsetHeight;}
});
this.each(function(){
$(this).height(maxHeight + "px");
if (this.offsetHeight>maxHeight) {
$(this).height((maxHeight-(this.offsetHeight-maxHeight))+"px");
}
});
};
현재 아도비니즘 메뉴를 더 잘 재 작성할 수 있습니까?
많은 감사!
콜백에 경고가 걸려 있는지 확인해 보았습니까? 만약 그렇다면 우리가하는 코드는 당신의 equalHeight 함수에있다. – Colin
경고가 작동하지만 등 높이 기능이 작동하지 않습니다. – 3zzy