// var exmenu1, exmenu2; // (function($){ // var menu1, menu2; // var timeid = null; // $(function(){ // //$('#gnb-menu>ul>li>ul').height(0); // $('#gnb-menu>ul>li').hover(function(e){ // showmenu(this); // },function(e){ // timeid = window.settimeout(currentmenu, 1000); // }); // $('#gnb-menu>ul>li>ul>li').hover(function(e) { // hsubmenu(this); // }, // function(e) { // dsubmenu(this); // } // ); // $('#gnb-menu>ul>li>a:has(img)').click(function(e){ // //ipad 救靛肺捞殿// 磐摹 扁扁甫 困茄 贸府 // var p = $(this).parent('li'); // var extendedheight = getgoalheight(p); // if (p.children('ul').height() != extendedheight) // e.preventdefault(); // } // ); // initialmenu(); // currentmenu(true);//ani 累悼 窍瘤 臼澜 // linemap(); // onevent(); // }); // var getgoalheight = function(obj){ // return $(obj).find('ul li').size() * 15 + 5; // } // var showmenu = function(obj,idx, noani){ // if (timeid != null) // window.cleartimeout(timeid); // if (idx != undefined) // obj = $('#gnb-menu>ul>li').eq(idx); // var goalheight = getgoalheight(obj); // var child = $(obj).children('.menu_child'); // if (noani) {} // //child.stop().show().height(goalheight); // else{ // child.stop().slidedown(); // } // //child.stop().show().animate({height:goalheight}); // //促弗 巴甸 绝俊扁 // $('#gnb-menu>ul>li').not(obj).each(function(){hidemenu(this)}); // }; // var hidemenu = function(obj,idx){ // if (idx != undefined) // obj = $('#gnb-menu>ul>li').eq(idx); // //if($(obj).index() != menu1) // ////$(obj).children('ul').stop().animate({height:0},function(){}); // $(obj).children('.menu_child').stop().slideup(); // }; // var hsubmenu = function(obj, idx1, idx2){ // if (idx1 != undefined && idx2 != undefined) // obj = $('#gnb-menu>ul>li:eq('+idx1+')>ul>li').eq(idx2); // $(obj).addclass('on') // }; // var dsubmenu = function(obj, idx1, idx2){ // if (idx1 != undefined && idx2 != undefined) // obj = $('#gnb-menu>ul>li:eq('+idx1+')>ul>li').eq(idx2); // //泅犁 困摹啊 酒匆 版快 // if($(obj).index() != menu2 || $(obj).parents('#gnb-menu>ul>li').index() != menu1) // $(obj).removeclass('on') // }; // var currentmenu = function(isloading){ // if (menu1 != undefined) showmenu('',menu1,isloading); // else $('#gnb-menu>ul>li').each(function(){hidemenu(this)}); // if (menu1 != undefined && menu2 != undefined) // hsubmenu('',menu1,menu2); // }; // var initialmenu = function(){ // //泅犁 困摹 啊廉坷扁 // if (exmenu1 == undefined || exmenu2 == undefined){ // var filter = location.href.substring(location.href.lastindexof('/')+1);//颇老疙栏肺 鞘磐傅 // var filter2 = filter; // if(filter.indexof('?') > 0){ // filter2 = filter2.substring(0, filter2.indexof('?')); // } // if (filter.indexof('#') > 0){ // filter2 = filter2.substring(0, filter2.indexof('#')); // } // var current = $('#gnb-menu a[href*="'+filter2+'"]:not(:has(img)), #gnb-menu a[rel*="'+filter2+'"]:not(:has(img))'); // //咯矾俺啊 唱棵 版快绰 ? 捞窍鳖瘤 厚背窃 // if(current.size() != 1) // current = $('#gnb-menu a[href*="'+filter+'"]:not(:has(img)), #gnb-menu a[rel*="'+filter+'"]:not(:has(img))'); // //辑宏 皋牢捞哥, 辑宏客 促甫 版快 // if(current.size() != 1) // { // current = $('#gnb-menu a[href*="'+filter2+'"]:has(img), #gnb-menu a[rel*="'+filter2+'"]:has(img)'); // if(current.size() != 1) // current = $('#gnb-menu a[href*="'+filter+'"]:has(img), #gnb-menu a[rel*="'+filter+'"]:has(img)'); // if(current.size() == 1){ // menu1 = current.parents('#gnb-menu>ul>li').index(); // return; // } // } // if(current.size() != 1) return; // var topwrapper = current.parents('#gnb-menu>ul>li'); // var parentwrapper = current.parent('li'); // menu1 = topwrapper.index();//$('#gnb-menu>ul>li').index(topwrapper); // menu2 = parentwrapper.index(); // //#俊 措茄 抗寇 // if (menu1 < 0) menu1 = undefined; // if (menu2 < 0) menu2 = undefined; // } // else // { // //荐悼栏肺 涝仿窍扁 // menu1 = exmenu1; // menu2 = exmenu2; // } // }; // var linemap = function(){ // if (menu1 == undefined) // return; // var linemap = 'home '; // var d2obj = $('#gnb-menu>ul>li:eq('+menu1+')>a'); // if (menu2 != undefined){ // linemap+=' > ' + d2obj.children('img').attr('alt') +''; // var d3obj = d2obj.parent('li').find('ul li:eq('+menu2+')'); // linemap+= ' > ' + d3obj.children('a').text() +''; // } // else // linemap+=' > ' + d2obj.children('img').attr('alt') +''; // $('#header .path').html(linemap); // }; // var onevent = function(){ // if ($('#gnb-event').size() == 0 ) // return; // var ct; // ct = $('#gnb-event dl dt ul li').size(); // onslide(0); // var _intervalid; // var currentnum=0; // var _width = 160; // $('#gnb-event dl dd ul li').eq(0).css('left',0); // timerhandler('start'); // $('#gnb-event dl dt ul li').bind("mouseover",function(){ // timerhandler('stop'); // var overnum = $(this).index(); // onslide(overnum); // }); // $('#gnb-event dl dt ul li').bind("mouseout",function(){ // timerhandler('start'); // }); // $('#gnb-event dl dd ul li').mouseover(function(){ // timerhandler('stop'); // }); // $('#gnb-event dl dd ul li').mouseout(function(){ // timerhandler('start'); // }); // function onslide(id){ // $('#gnb-event dl dt ul li').each(function(i){ // if(i==id){ // $(this).find('a img').attr('src','/static/images/common/gnb-event-on.gif'); // } // else{ // $(this).find('a img').attr('src','/static/images/common/gnb-event-off.gif'); // } // }); // if(currentnum!=id){ // $('#gnb-event dl dd ul li').eq(currentnum).stop(); // $('#gnb-event dl dd ul li').eq(currentnum).animate({left:-1 * _width}, 500, 'easeoutcubic'); // $('#gnb-event dl dd ul li').eq(id).css('left', _width); // $('#gnb-event dl dd ul li').eq(id).stop(); // $('#gnb-event dl dd ul li').eq(id).animate({left:0}, 500, 'easeoutcubic'); // currentnum = id; // } // } // function timerhandler(state){ // if(state == 'start'){ // _intervalid = setinterval(function(){ // var id = currentnum + 1; // if(id == ct) id = 0; // onslide(id); // }, 3500); // } else { // clearinterval(_intervalid); // } // } // } // })(jquery); function menu(){ var isin = false, st; var _this; $(".nav > li").each(function(e){ $(this).click(function(){ _this = $(this); st = settimeout(function(){ _this.find(".menu_child").stop(false, true).slidedown().parent().siblings().find(".menu_child").stop(false, true).slideup(); }, 300) }, function(){ cleartimeout(st); //$(this).find(".menu_child").stop(false, true).slideup(); }) }); } $(function(){ menu(); });