//菜单高度参数初始化全局变量; var winw=$(window).width(),winh=$(window).height(), navbarheight=$('.navbar').innerheight(), menuitemcount=$(".navdir>li").length, menubaritemstartheight=(winh-navbarheight-menuitemcount)/menuitemcount; // menudir height resize $(function(){ $(window).bind('resize',function(){ closemenudir(); var winw=$(window).width(), winh=$(window).height(); navbarheight=$('.navbar').innerheight(); menubaritemstartheight=(winh-navbarheight-menuitemcount)/menuitemcount; $(".navdir a.title").css({ height:menubaritemstartheight,'line-height':menubaritemstartheight+'px' }); $(".navdir>li").css({ height: menubaritemstartheight }); }).trigger('resize'); }); // show menudir btn event; $('.menu').click(function(event) { $('.navhome').animate({ //隐藏原导航 'margin-top': -30, opacity: 0}, 300, function() { //显示全导航 $('.navbar').css({display:'block',opacity:0,top:-20}); $('.navbar').animate({opacity: 1, top: 0}, 200,function(){ $('.navdir').css({display:'block'}); $('.navdir>li').css({display:'block',opacity:0}); $('.navdir>li').each(function(index,item){ var that=$(this); // 菜单钢琴特效 settimeout(function(){ that.animate({height:menubaritemstartheight,opacity: 1, top: 0}, 200,'easeoutquad'); }, 50*index); }); }); }); }); //二级菜单显示 $('.navdir>li').hover(function() { $('.navdir>li .submenu').hide(); var submenuheight=$(this).find('li').length*24,that=$(this); // 设置垂直居中 if(submenuheight+25li').hide(); $('.navbar').hide(); $('.navhome').animate({'margin-top': 0, opacity: 1}, 300); } $(function(){ $(window).bind('resize',function(){ var winw=$(window).width(), winh=$(window).height(); $('.fullgrid').each(function(index, el) { if($(el).attr('oldhieght')==undefined){ $(el).attr('oldhieght',$(el).height());} if(parseint($(el).attr('oldhieght'))0 && banner.length>0){ var bannerheight=banner.height(), banneroffsety=banner.offset().top; if(toolsbars.attr('data-state')!='display' && _scrolltop>=(bannerheight-100)){ toolsbars.addclass('show'); btndown.css({opacity:0}) toolsbars.attr('data-state','display'); } if( _scrolltop<(bannerheight-100)){ toolsbars.attr('data-state','hide'); toolsbars.removeclass('show'); btndown.css({opacity:1}) } } if(banner.length==0){ toolsbars.addclass('show'); toolsbars.attr('data-state','display'); } }); });