=== 타이틀, 컨텐츠 분리된 부분
$(document).on('click', '.accodion .accodion-arrow', function(){
$('.accodion-contents').slideUp(200);
if($(this).parent().hasClass('active')) {
$('.accodion').removeClass('active');
$(this).parent()removeClass('active');
}else{
$('.accodion').removeClass('active');
$(this).parent().children('.accodion-contents').slideDown(200);
$(this).parent().addClass('active');
}
});
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
/* ==============================
* 아코디언 (accordion) - 타이틀, 컨텐츠 합쳐진 부분
* ============================== */
$('.sale-list.accordion02').each(function(index, elem) {
if ($(this).find(".accordion-whole").height() > 190 ) {
$(this).removeClass('not');
$(this).addClass('active02');
} else {
$(".accordion-whole").removeClass('active02');
$(this).addClass('not');
}
});
$(document).on('click', '.sale-list.active02 .accordion-arrow', function () {
if ($(this).prev(".accordion-whole").hasClass('current')) {
$(this).prev(".accordion-whole").removeClass('current');
} else {
$(".sale-list.active02").find(".accordion-whole").removeClass('current');
$(this).prev(".accordion-whole").addClass('current');
}
});
/* ==============================
* 아코디언 (accordion) - 고객정보(2줄만 보이게)
* ============================== */
$('.accordion-ver2-wrap').each(function(index, elem) {
if ($(this).find(".accordion-ver2").height() > 46 ) {
$(this).addClass('active');
} else {
$(this).removeClass('active');
}
});
if ($(this).parent('.accordion-ver2-wrap').hasClass('show')) {
$('.accordion-ver2-wrap').removeClass('show');
$(this).parent('.accordion-ver2-wrap').removeClass('show');
} else {
$('.accordion-ver2-wrap').removeClass('show');
$(this).parent('.accordion-ver2-wrap').addClass('show');
}
});
|
'javascript, JQuery' 카테고리의 다른 글
[javascript] 배열 값 중복제거, 배열합치기 (0) | 2020.07.06 |
---|---|
[Jquery] 데이터 포맷(날짜에 하이픈 넣기) (0) | 2020.04.27 |
[Jquery] anypicker (0) | 2020.04.13 |
ajax 페이징처리 (더보기) (5) | 2020.03.03 |
JSON 객체변환(파싱) , Cilck 이벤트 (0) | 2020.02.28 |