본문 바로가기
jQuery/jQuery 기본

display flex 풀릴때 제이쿼리로 적용

by hyojinny 2022. 11. 10.

 

display flex 가 적용된 하위요소에

 

display:none 적용시 flex 가 사라진다. 

 

이때 제이쿼리를 사용해서 꺼야함


이런 상황에 display가 제대로 적용이 되지않아 요소가 깨지는 모습

 

 

 


제이쿼리적용으로 depth02 꺼주기

  $('#header .gnb .depth02').hide();
  $('#header .gnb>li>a').on('click', function () {
    // 버튼하나만 돌아가게하기
    $(this).parent().toggleClass('on').siblings().removeClass('on');
    $(this).next().slideToggle();
  });

댓글