$(function() { var gnb = $(".inwrap > ul > li"); var gnb2 = $("#header"); var snb = $(".snb"); var winWidth2 = $(window).width(); if (winWidth2 > 10) { gnb.click(function() { if(!$(this).hasClass('on')) { $(".inwrap > ul > li").removeClass('on'); $(".inwrap > ul > li").find('.submun').stop().slideUp(350); //$(".inwrap > ul > li").css("transition-delay","1.1s"); $(this).addClass('on'); $(this).find('.submun').stop().slideDown(350); //$(this).find('.submun').css("display","block"); /*$("#header .bg").stop(true, false).animate({ opacity: '1' }, 200);*/ } else { $(this).removeClass('on'); $(this).find('.submun').stop().slideUp(350); //$(this).find('.submun').css("display","none"); } }); /*gnb.mouseleave(function() { $(this).find('.submun').stop().slideUp(350); $(this).find('.submun').css("display","none"); $("#header .bg").stop(true, false).animate({ opacity: '0.7' }, 400); });*/ } if (winWidth2 > 10) { gnb2.mouseenter(function() { $("#header .bg").stop(true, false).animate({ opacity: '1' }, 200); }); gnb2.mouseleave(function() { $("#header .bg").stop(true, false).animate({ opacity: '0.7' }, 400); }); } // URL ÆĶó¹ÌÅÍ ºÒ·¯¿À±â var getUrlParameter = function getUrlParameter(sParam) { var sPageURL = decodeURIComponent(window.location.search.substring(1)), sURLVariables = sPageURL.split('&'), sParameterName, i; for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); if (sParameterName[0] === sParam) { return sParameterName[1] === undefined ? true : sParameterName[1]; } } }; $(function(){ var tabCheck = getUrlParameter('top')-1; //var tabCheck = getUrlParameter('sub')-1; var tab = $("#gnb > ul > li"); tab.eq(tabCheck).addClass('on'); }); });