page. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]

32일차

1. 아코디언 → 양옆에 나오게 하기(next, prev 실무 많이 씀)

$('.box-1 > *').click(function() {
  let $this = $(this);
  
  $this.removeClass('active');
  $this.prev().addClass('active');   //디스 이전거 선택
  $this.next().addClass('active');    //디스 다음거 선택
});

2. 아코디언 → 마우스 가져다 놓으면 나오게 하기

a. 사용코드

b. 내용

$('.box-1 > *').mouseenter(function() {
  let $this = $(this);
  
  $this.removeClass('active');
  $this.prev().addClass('active');
  $this.next().addClass('active');
});