var istouch = modernizr.touch, ismobile = false,//区分移动端与pc端 mobile = false,//区分手机端与平板 w_width = 0, w_height = 0, bannerimgh=638, navitem = 0, h_height=0, roll=0, stop=150, produs=0, st = 0; var _mousemove; var _click; var _mousedown; var _mouseup; //移动端事件和pc事件的切换 if (modernizr.touch) { _mousemove = "touchmove"; _click = "touchend"; _mousedown = "touchstart"; _mouseup = "touchend"; } else { _mousemove = "mousemove"; _click = "click"; _mousedown = "mousedown"; _mouseup = "mouseup"; }; function pagebox() { w_width = jquery(window).width(); w_height = jquery(window).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; }; if (w_width >= 1024) { } if(!ismobile){ var content=$(".inner").width(); $(".honor-left").width((w_width-content)/2); st = $(window).scrolltop(); roll=$('.header-box').outerheight()+$('.siderbanner').height()+$('.grade-box').outerheight(); if(st>=roll){ $('.flex-common').addclass('flex'); }else{ $('.flex-common').removeclass('flex'); } $(window).scroll(function(){ st = $(window).scrolltop(); roll=$('.header-box').outerheight()+$('.siderbanner').height()+$('.grade-box').outerheight(); if(st>=roll){ $('.flex-common').addclass('flex'); }else{ $('.flex-common').removeclass('flex'); } }); }else{ } if(w_width <= 486){ $(".welfare-info").width($(".welfare-fix").width()); } } pagebox(); jquery(window).resize(function () { pagebox(); }); $(".navigate .navbtn").click(function(){ $(".popmark").fadein(480); $('.menu-box').addclass('on'); }); $(".close,.popmark").click(function(){ $(".popmark").fadeout(); $('.menu-box').removeclass('on'); }); $('.iphone-menus > span').bind('click',function (){ $('.iphonemakr,.menu-fix').addclass('on'); }); $(".menu-fix span,.iphonemakr").click(function(){ $('.iphonemakr,.menu-fix').removeclass('on'); }); var spam=""; var text=""; $('.select-info span').click(function(e) { e.stoppropagation(); $(this).parents('.select-info').find('ul').stop(true,true).slidetoggle(); }); $('.select-info ul li').click(function(e){ e.stoppropagation(); text=$(this).text(); $(this).parents('.select-info').find('span').text(text); $(this).parents('.select-info').find('ul').stop(true,true).slidetoggle(); }); $(document).on('click',function(e){ e.stoppropagation(); $(".select-info ul,.link-list").slideup(); }); $(".link-down").on("click",function(e){ e.stoppropagation(); $(this).find('.link-list').stop().slidetoggle(); }); $(".edite-ri span").click(function(e){ jquery("html,body").animate({ scrolltop:0}, 1200, 'easeinoutexpo'); }); jquery(".menu-list >li >a").bind("click", function (e) { var $navmobile=jquery(".mobile-menu"), $nava=$navmobile.find(".menu-list >li >a"), $msubnav=$navmobile.find(".iphone-menu"); var hjcur = $(this); var hjdd = $(this).parents("li"); if (hjdd.find(".iphone-menu").size() > 0) { if (hjcur.hasclass("on")) { $navmobile.slideup(); hjdd.find(".iphone-menu").stop(false, false).slideup(); hjcur.removeclass("on"); $navmobile.slideup(); } else { $nava.removeclass("on"); $msubnav.stop(false, false).slideup(); hjdd.find(".iphone-menu").stop(false, false).slidedown(); hjcur.addclass("on"); e.preventdefault(); } } }); $(".iphone-menu li").click(function(){ $(this).addclass('cur').siblings().removeclass('cur'); }); gethash(); jquery(".technology-list >li >a,.nav-info a,.flex-list li a,.iphone-menu li a").click(function(e){ var hash=jquery(this).attr("href").split("#")[1]; if(hash && jquery("#"+hash).length==1){ e.preventdefault(); setscroll("#"+hash); } $(".popmark").fadeout(); $('.menu-box').removeclass('on'); $('.iphonemakr,.menu-fix').removeclass('on'); }); function gethash(){ var hash = location.href.split("#")[1]; if(hash){ setscroll("#"+hash); } }; var scnum=76; function setscroll(anchorcur){ if(!ismobile){ scnum=0; }else{ scnum=$(".header-box").outerheight(); } jquery("html,body").animate({ scrolltop: jquery(anchorcur).offset().top-scnum},500,'easeinoutexpo'); }; $('.relevantbanner').owlcarousel({ items:3, slidespeed:1000, navigation: true, pagination: false, controls:true, itemsdesktop: [1199, 3], itemsdesktopsmall: [1024, 3], itemstablet: [860, 2], itemstabletsmall: false, itemsmobile: [480, 1] }); var i = $(".flex-list li.on").index(); $(".flex-list li").bind("mouseenter", function () { $(this).addclass("on"); $(this).siblings().removeclass("on"); }); $(".flex-list li").bind("mouseleave", function () { $(this).removeclass("on"); $(".flex-list li").eq(i).addclass("on"); }); $(".page a").hover(function(){ $(this).parents('.page').toggleclass('on'); }); setpopup($('.weixin'), "官方微信"); function setpopup(obj, title) { obj.click(function () { var str = '
'; $("body").append(str); jquery(".popupblack").fadein(); jquery(".popup").animate({margintop:"-127"},400); $(".popup .close").click(function () { $(".popupblack").remove(); }); jquery(".popupblack").click(function(){$(".popupblack").remove();}); return false; }); }; function setimgmax(img, imgw, imgh, tw, th) { var twidth = tw || w_width; var theight = th || w_height; var coe = imgh / imgw; var coe2 = theight / twidth; if (coe < coe2) { var imgwidth = theight / coe; img.css({ height: theight, width: imgwidth, left: -(imgwidth - twidth) / 2, top: 0 }); } else { var imgheight = twidth * coe; img.css({ height: imgheight, width: twidth, left: 0, top: -(imgheight - theight) / 2 }); }; };