$(function () {
$('#header .gnb>li').on('mouseenter', function () {
// 각 li에 마우스를 올렸을때 자신 안쪽depth02 보여주고 나머지 형제안의 depth02안보이게
$(this).find('.depth02').show().parent().siblings().find('.depth02').hide();
$('#header').addClass('on');
});
$('#header').on('mouseleave', function () {
$('#header').removeClass('on');
// 헤더에서 마우스 빠졌을때만 서브메뉴 안보이게
$('#header .gnb .depth02').hide();
});
});
원본참고
'jQuery > jQuery 기본' 카테고리의 다른 글
제이쿼리 애니메이션 효과 (0) | 2022.10.31 |
---|---|
제이쿼리 애니메이션 바 추가 mouseenter (0) | 2022.10.31 |
제이쿼리 기본정리 (0) | 2022.10.27 |
제이쿼리 scroll/animate (0) | 2022.10.24 |
05_효과메서드,jQueryUI확장라이브러리,헤더전체메뉴 (0) | 2022.10.20 |
댓글