var istouch = modernizr.touch, ismobile = false,//区分移动端与pc端 mobile = false,//区分手机端与平板 w_width = 0, w_height = 0, $mtoph = 0, st = 0, navitem = 0, $menubtn=$('.menubtn'), $menubox=$(".menubox"); //移动端事件和pc事件的切换 var _mousemove; var _click; var _mousedown; var _mouseup; if (modernizr.touch) { _mousemove = "touchmove"; _click = "touchend"; _mousedown = "touchstart"; _mouseup = "touchend"; } else { _mousemove = "mousemove"; _click = "click"; _mousedown = "mousedown"; _mouseup = "mouseup"; }; function pagebox() { w_width = $(window).width(); w_height = $(window).height(); $mtoph = $('.mtop').height(); if (w_width <= 1024) { ismobile = true; } else if (w_width > 1024) { ismobile = false; }; if (w_width <= 640) { mobile = true; } else if (w_width > 640) { mobile = false; }; changepnav(); }; pagebox(); $(window).resize(function () { pagebox(); }); $(function () { $('.hdbtn').mouseenter(function(){ $(this).addclass('act'); $(this).parent().find('.c-hide-box').addclass('show'); }); $('.myhidelayer').mouseleave(function(){ $(this).find('.hdbtn').removeclass('act'); $(this).find('.c-hide-box').removeclass('show'); }); $('.navmobile dd p a').click(function(e){ if($(this).parent().next('.mtnav').size() >= 1){ if(!$(this).hasclass('act')){ e.preventdefault(); $('.navmobile dd p a').removeclass('act'); $('.mtnav').stop().slideup(300); $(this).addclass('act'); $(this).parent().next('.mtnav').stop().slidedown(300); }else{ $(this).removeclass('act'); $(this).parent().next('.mtnav').stop().slideup(300); } } }); $menubtn.bind(_click, function () { if (navitem == 0) { $('.menublack').stop().fadein(); jquery(this).addclass("open"); $menubox.show().stop(false,false).animate({right:0}); navitem = 1; } else { $('.menublack').stop().fadeout(); $(this).removeclass("open"); $menubox.stop(false,false).animate({right:-320+"px"},function(){ $(this).hide(); }); navitem = 0; }; }); $('.menublack').bind(_click, function () { $(this).stop().fadeout(); $menubtn.removeclass("open"); $menubox.stop(false,false).animate({right:-320+"px"},function(){ $(this).hide(); }); navitem = 0; }); $(window).scroll(function () { var windowtop = $(window).scrolltop(); if (windowtop < w_height && !ismobile) { $('.pbanner .pic2 img').css('transform', "translate(0px," + (windowtop) / 1.5 + "px)"); }; changepnav(); }); changepnav(); function setscroll(anchorcur){ if(jquery(anchorcur).length>=1){ jquery("html,body").animate({ scrolltop: jquery(anchorcur).offset().top-$mtoph}, 0); } }; window.onload = function () { var hash = location.href.split("#")[1]; if (hash) { setscroll("#" + hash); } } settimeout(function(){ $('.pbtxts').addclass('animation'); },100); //weixin setpopup($('.weixin'), "官方微信"); function setpopup(obj, title) { obj.click(function () { var str = '