Home Ads

[제이쿼리] hover -> .stop(true,true)



*위쎈(http://www.bulgariswissen.com/weissen1707/index.asp)
페이지 상단 네비부분 호버했을 때 서브네비가 내려와야 함.
처음에 마우스리브를 썼었는데 마우스가 왔다갔다 하는 액션을 다 받아서
서브네비가 메롱거림...

=> 클릭 시 버블링 막아주고, .stop(true,true) 넣어주면 괜찮아진다. 기억하기~!




$('#header .gnb .health_nav').hover(function(e){
e.preventDefault();
e.stopPropagation();
$(this).children('a').stop(true,true).addClass('on');
$(this).children('ul').stop(true,true).slideDown();
},function(e){
$(this).children('ul').stop(true,true).slideUp();
$(this).children().stop(true,true).removeClass('on');

});
[제이쿼리] hover -> .stop(true,true) [제이쿼리] hover ->  .stop(true,true) Reviewed by 코알라 on 9월 20, 2018 Rating: 5

댓글 없음:

페이지

Powered by Blogger.