gnb.pc.js 와 gnb.mobile.js 모두 layout.js 로 통합. html에서 해당 js로드되는 부분 제거 및 슬라이드에서 좌우 버튼 IE8대응

This commit is contained in:
dlehdanakf 2015-07-06 11:24:43 +09:00
parent d6bcd43964
commit 1af83bf89a
5 changed files with 39 additions and 53 deletions

View file

@ -38,6 +38,44 @@
});
$(window).triggerHandler('scroll');
}
// Gnb
if($(document).width() > 480){
$gnb.find('>ul>li>a')
.mouseover(function(){
$gnb.find('>ul>li>ul:visible').hide().parent('li').removeClass('on');
$(this).next('ul:hidden').stop().fadeIn(200).parent('li').addClass('on')
})
.focus(function(){
$(this).mouseover();
})
.end()
.mouseleave(function(){
$gnb.find('>ul>li>ul').hide().parent().removeClass('on')
});
$gnb.find('>ul>li>ul>li>a')
.mouseover(function(){
$gnb.find('>ul>li>ul>li>ul:visible').hide().parent('li').removeClass('on');
$(this).next('ul:hidden').stop().fadeIn(200).parent('li').addClass('on')
})
.focus(function(){
$(this).mouseover();
})
.end()
.mouseleave(function(){
$gnb.find('>ul>li>ul>li>ul').hide().parent().removeClass('on')
});
}
$("#mobile_menu_btn").on('click', function(){
var isOpened = $(this);
if(isOpened.hasClass('opened')){
$("#gnb").find(">ul").slideUp(200);
}else{
$("#gnb").find(">ul:not(:animated)").slideDown(200);
}
isOpened.toggleClass('opened');
});
// login popup
$hoverEl.on('mouseenter mouseleave focusin focusout',function(e){
e.preventDefault();