반응형
#아코디언 메뉴
$(function(){
var acodian = {
click: function(target) {
var _self = this,
$target = $(target);
$target.on('click', function() {
var $this = $(this);
if ($this.next('.real_content').css('display') == 'none') {
$('.real_content').slideUp();
_self.onremove($target);
$this.addClass('on');
$this.next().slideDown();
} else {
$('.real_content').slideUp();
_self.onremove($target);
}
return false;
});
},
onremove: function($target) {
$target.removeClass('on');
}
};
acodian.click('.post-row > a');
});
.real_content{
display:none;
}
#아코디언 메뉴_더 간단하게!(by.써니)
var kh_tit = $('.khnow_head');
$(kh_tit).click(function(){
$(this).siblings('.khnow_con').slideToggle().parent('li').toggleClass('on').siblings('li').removeClass('on').find('.khnow_con').slideUp();
});
728x90
반응형
'JS & jQuery' 카테고리의 다른 글
호버된 이미지 변경 (0) | 2022.01.24 |
---|---|
라디오 버튼 선택시 활성화&비활성화 (0) | 2022.01.24 |
이미지맵 (0) | 2022.01.17 |
wing 배너(fix) (0) | 2022.01.17 |
top 버튼& down 버튼 (0) | 2022.01.17 |