menuFlag = true; sw = $(window).width(); sh = $(window).height(); $(document).ready(function() { sw = $(window).width(); sh = $(window).height(); set_ui(); gnb(); selectFooter(); selectTmenu(); if($('#wrap').hasClass('sub')){ SubVisual = new subVisual(); } if($('#wrap').hasClass('main')){ mainInit(); } }); function set_ui(){ var UserAgent = navigator.userAgent; var UserFlag = true; if (UserAgent.match(/iPhone|iPod|Android|Windows CE|BlackBerry|Symbian|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson/i) != null || UserAgent.match(/LG|SAMSUNG|Samsung/) != null) { //mobile!! UserFlag = false; } return UserFlag };//end set_ui /************************ @ 상단메뉴 ************************/ function gnb(){ Gtarget = $('.gnb_wrap'); G_h = $('.gnb_wrap').height(); //gnb 고유높이값 Gtarget.find('> ul > li a').bind('mouseenter focus click',function(){ snb_Flag(0); }); Gtarget.bind('mouseleave',function(){ snb_Flag(1); }); $('.otherMenu').find('a').focus(function(){ snb_Flag(1); }); Gtarget.find('> ul > li').bind('mouseenter mouseleave',function(event){ if(event.type=='mouseenter'){ if(!$(this).hasClass('current')){ $(this).addClass('current'); } }else{ if(!$(this).hasClass('actived')){ $(this).removeClass('current'); } } }); //메뉴 초기화 Gtarget.css({'height':60,'visibility':'visible'}); if($('body').hasClass('mobile')){ Gtarget.find('> ul > li > a').attr('href','javascript:;'); } } //서브메뉴 보이기 안보이기 function snb_Flag(n){ if(n==0){ //배경 $('p.snb_bg').stop().css('display','block').animate({'height':G_h-60},900,'easeOutExpo'); //snb Gtarget.stop().animate({'height':G_h},900,'easeOutExpo'); }else{ //배경 $('p.snb_bg').stop().animate({'height':0},900,'easeOutExpo',function(){$(this).css('display','none');}); //snb Gtarget.stop().animate({'height':60},900,'easeOutExpo'); } }