/*$(document).ready(function(){ $("#gnb").hover( function(){ $("#snb01").show(); }, function(){ $("#snb01").hide(); } ); $("#snb01").hover( function(){ $("#snb01").show(); }, function(){ $("#snb01").hide(); } ); }); */ /*$(document).ready(function(){ $(".topnav").hover(function() { $(this).parent().find(".subnav").slideDown('normal').show(); $(this).parent().hover(function() { }, function(){ $(this).parent().find(".subnav").slideUp('fast'); }); }); }); ; */ $(document).ready(function(){ var duration=500; $(".topnav").on('hover',function(){ $(this).parent().find(".subnav").toggleClass('open'); if ($(this).parent().find(".subnav").hasClass('open')) { //aside가 클래스명 open을 가지고 있으면 $(this).parent().find(".subnav").stop(true).animate({ display:'block', opacity:'1' },duration); } else{ $(this).parent().find(".subnav").stop(true).animate({ display:'none', opacity:'0' },duration); }; }); $(".subnav").on('hover',function(){ $(this).toggleClass('open'); if ($(this).hasClass('open')) { //aside가 클래스명 open을 가지고 있으면 $(this).stop(true).animate({ display:'block', opacity:'1' },duration); } else{ $(this).stop(true).animate({ display:'none', opacity:'0' },duration); }; }); }); ; function setPage(arg) { //navigation hn:1depth, sn:2depth, cn:3depth 를 받음 page = jQuery.extend({ hn : "", sn : "", cn : "" }, arg || {}); if(window.console) { console.log("hn : " + page.hn + "\nsn : " + page.sn + "\ncn : " + page.cn); } if(page.hn != 10) { $(".snb ul li.hn" + page.hn + " a").addClass("on"); //1depth 활성 } if(page.hn >= 11) { $(".snb ul li.hn" + page.hn + " a").addClass("on"); //유틸 1depth 활성 } $(".snb dd.sn" + page.sn).find("> a").addClass("on").end().find("> ul").addClass("on").find("> li.cn" + page.cn + " a").addClass("on"); //2depth 활성 }