$(function(){ //二级导航 function fnSubnav(){ var $o = $('.menubox'); var $nav = $('.menubox li'); var $info = $('.Nav1'); var $sub = $('.subnav'); var $item = $sub.find('.Nav2'); var $timer = null; $item.each(function(e){ $(this).find('ul').addClass('s'+e); }) $nav.each(function(e){ if (e==0) { $(this).mouseenter(function(){ $sub.hide(); $info.show(); }) } else { if ( $(this).hasClass('on') && $item.eq(e).find('li').length!=0 ) { $info.hide(); $sub.show(); $item.eq(e).show(); } $(this).mouseenter(function(){ if ( $item.eq(e).find('li').length!=0 ) { $info.hide(); $sub.show(); $item.hide(); $item.eq(e).show(); } else { $sub.hide(); $info.show(); } }) } }) function goBackNav(){ $nav.each(function(e){ if ($(this).hasClass('on')&&e!=0) { if ($item.eq(e).find('li').length!=0) { $info.hide(); $sub.show(); $item.hide(); $item.eq(e).show(); } else { $sub.hide(); $info.show(); } } if ($(this).hasClass('on')&&e==0) { $sub.hide(); $info.show(); } }) } $o.hover(function(){ clearInterval($timer); },function(){ $timer = setTimeout(goBackNav,100); }) $sub.hover(function(){ clearTimeout($timer); },function(){ $timer = setTimeout(goBackNav,100); }); $item.eq($o.find(".on").index()).show().siblings().hide(); $item.each(function(){ $(this).find('li').last().css('background','none'); }) } fnSubnav(); }) //字体设置 $(function(){ $('#f-big').click(function(){$('.wzcon,.wzcon *').css('fontSize','18px');return false;}); $('#f-normal').click(function(){$('.wzcon,.wzcon *').css('fontSize','16px');return false;}); $('#f-small').click(function(){$('.wzcon,.wzcon *').css('fontSize','14px');return false;}); }); //下拉友情链接调用 function MM_o(selObj){ if(selObj.options[selObj.selectedIndex].value=="#"){ }else{ window.open(selObj.options[selObj.selectedIndex].value); } }