$(function() { function ThisIsPC() { var userAgentInfo = navigator.userAgent; var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; var flag = true; for (var v = 0; v < Agents.length; v++) { if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; } } return flag; } ;(function(){ function lengthCile(obj,num){ obj.each(function(i,e){ $(e).css({height:'auto'}); if($(e).text().length > num){ $(e).text($(e).text().slice(0,num)+'...'); } }) } lengthCile($('.hotActivityBottom .hotP'),140); lengthCile($('.tendencyText .hotP'),140); lengthCile($('.tendencyOut .hotP'),140); lengthCile($('.bestContentP'),65); })() var src = "images/"; //琛屼笟瀹炶返涓嬮潰icon鍒囨崲鍔ㄧ敾鏁堟灉 $(".chooseItem").on({ mouseenter:function(){ // var arr = $(this).find(".tableIcon").attr("src").split("_"); if(isPc()){ var num=$(this).attr("num"); $(this).find(".tableIcon").attr("src",src+"industry_small_"+num+"_2.png"); $(this).find(".tableChooseP").css("color","#e60012"); } }, mouseleave:function(){ if(isPc()){ var num=$(this).attr("num"); $(this).find(".tableIcon").attr("src",src+"industry_small_"+num+"_1.png"); $(this).find(".tableChooseP").css("color","#666"); } } }); //琛屼笟瀹炶返鏁板瓧鏁堟灉寮€濮 var _num=''; var numnub=0; var setNum; function addnum(overnum){ $(".hangPc").find(".addHover").eq(0).find('.num').html('30'); $(".hangPc").find(".addHover").eq(1).find('.num').html('70'); $(".hangPc").find(".addHover").eq(2).find('.num').html('10'); numnub++; if(numnub>overnum){ clearTimeout(setNum); return false; } if(_num.attr('num')==3){ _num.find('.num').html(numnub); setNum=setTimeout(function(){ addnum(overnum) },5) }else if(_num.attr('num')==4){ _num.find('.num').html(numnub); setNum=setTimeout(function(){ addnum(overnum) },50) }else{ _num.find('.num').html(numnub); setNum=setTimeout(function(){ addnum(overnum) },10) } } //琛屼笟瀹炶返鏁板瓧鏁堟灉缁撴潫 //琛屼笟瀹炶返涓讳綋鍒囨崲鍔ㄧ敾鏁堟灉 $(".hangPc").find(".addHover").on({ mouseenter:function(){ var num=$(this).attr("num"); $(this).css("background-color","#f9f9f9"); $(this).find(".bestContentTitle").css("color","#e60012"); $(this).find(".bestTitle").css("color","#e60012"); $(this).find(".peopleIcon").attr("src",src+"industry_big_"+num+"_2.png"); _num=$(this); $(this).find('.num').html('0'); numnub=0; if(num==1){ addnum(30); }else if(num==3){ addnum(70); }else if(num==4){ addnum(10); } }, mouseleave:function(){ var num=$(this).attr("num"); $(this).css("background-color","#fff"); $(this).find(".bestContentTitle").css("color","#333"); $(this).find(".bestTitle").css("color","#333"); $(this).find(".peopleIcon").attr("src",src+"industry_big_"+num+"_1.png"); clearTimeout(setNum); numnub=0; if(num==1){ $(this).find('.num').html('30'); }else if(num==3){ $(this).find('.num').html('70'); }else if(num==4){ $(this).find('.num').html('10'); } } }) //瓒嬪娍娲炲療閲岄潰鐨勬煡鐪嬫晥鏋 $(".lookAllAddHover").on({ mouseenter:function(){ $(this).css("color","#e60012"); $(this).find(".lookIcon").attr("src",src+"hot_img_arrow_hover.png"); }, mouseleave:function(){ $(this).css("color","#333"); $(this).find(".lookIcon").attr("src",src+"hot_img_arrow.png"); } }) // $(".hotActivitySwiper").on({ mouseenter:function(){ $(this).find(".hotA").css("color","#e60012"); $(this).find(".hotImgArrow").attr("src",src+"hot_img_arrow_hover.png"); }, mouseleave:function(){ $(this).find(".hotA").css("color","#333"); $(this).find(".hotImgArrow").attr("src",src+"hot_img_arrow.png"); } }); var maxWidth=$(".containerInnerBox").width()-32; var baseWidth=($(".containerInnerBox").width()-32)/4; if(isIE()){ $(".containerH3").addClass("containerH3isIE"); } $(window).resize(function(){ maxWidth=$(".containerInnerBox").width()-32; baseWidth=($(".containerInnerBox").width()-32)/4; $(".jiePc").find(".resolve").width(baseWidth); $(".jiePc").find(".resolveInnerBox").width(baseWidth); $(".resolveMakeBox").width(maxWidth); var maxW = $(".device").width(); $(".animateInner").width((maxW-40)/3); $(".animateBox").height($(".hotActivityInner").height()+4); changeBanner(); var width; if($('body').hasClass('ie8')){ width = $(".animateInner").width()+22; }else { width = $(".animateInner").width()+20; } $(".beAnimate").css({'left':-width*hotNum}); }) $(".resolveMakeBox").width(maxWidth); $(".jiePc").find(".resolve").width(baseWidth); $(".jiePc").find(".resolveInnerBox").width(baseWidth); //瑙e喅鏂规鍒掕繃鏁堟灉 $(".jiePc").find(".resolve").on("mouseenter",function(){ var num=$(this).attr("num"); var that=$(this); $(".jiePc").find(".resolve").addClass("resolveDelay"); $(".resolveMakeBox").removeClass("resolveDelay"); setTimeout(function(){ that.siblings().width(baseWidth); that.width(baseWidth+140); $(".resolveMakeBox").width((Number(maxWidth)+140)+"px"); if(num==4){ $(".resolveMakeBox").css("transform","translateX(-70px)"); }else{ $(".resolveMakeBox").css("transform","translateX(0px)"); } that.siblings().find(".maskBoxAdd").fadeIn(); that.find(".maskBoxAdd").fadeOut(); }) }); $(".searchIconBox").on("click",function(){ }) $(".resolveMakeBox").on("mouseleave",function(){ $(".jiePc").find(".resolve").removeClass("resolveDelay"); $(".resolveMakeBox").addClass("resolveDelay"); setTimeout(function(){ $(".resolveMakeBox").width(maxWidth); $(".jiePc").find(".resolve").width(baseWidth); $(".resolveMakeBox").css("transform","translateX(0px)"); }) }); if(!$("body").hasClass("ie8")){ var mySwiperHangMbl = new Swiper('.swiper-hotMbl',{ grabCursor: true, paginationClickable: true, pagination: '.pagination', paginationClickable: true, observer: true, observeParents: true }) var mySwiperHangMbl = new Swiper('.swiper-hangMbl',{ grabCursor: true, paginationClickable: true, pagination: '.paginationA', paginationClickable: true, observer: true, observeParents: true }) } //鐑偣娲诲姩鐐瑰嚮搴忓垪鍙疯褰曞彉閲 var hotNum = 0; $('.lookArrowLeft').on('click', function(e){ e.preventDefault(); if(hotNum>0){ hotNum--; if($('body').hasClass('ie8')){ var width = $(".animateInner").width()+22; }else { var width = $(".animateInner").width()+20; } $(".beAnimate").animate({"left":"-"+width*hotNum}) } }) $('.lookArrowRight').on('click', function(e){ e.preventDefault(); var len = $(".animateInner").length; if((len-3)>hotNum){ hotNum++; if($('body').hasClass('ie8')){ var width = $(".animateInner").width()+22; }else{ var width = $(".animateInner").width()+20; } $(".beAnimate").animate({"left":"-"+width*hotNum}) } }) $('.lookArrowLeft').on({ mouseenter:function(){ if(hotNum>0){ $(this).addClass("lookArrowLeftHover"); } }, mouseleave:function(){ $(this).removeClass("lookArrowLeftHover"); } }); $('.lookArrowRight').on({ mouseenter:function(){ var len = $(".animateInner").length; if((len-3)>hotNum){ $(this).addClass("lookArrowRightHover"); } }, mouseleave:function(){ $(this).removeClass("lookArrowRightHover"); } }); $(".for_text").on("click", function() { $(this).hide() }) changeBanner() function changeBanner(){ if(isPc()){ $('.halfChangeAllAdd .tendencyBox').eq(0).find('img').attr('src',src+'tendencyImg_5.jpg'); $('.halfChangeAllAdd .tendencyBox').eq(1).find('img').attr('src',src+'tendencyImg_6.jpg'); // 淇敼搴曢儴鍥剧墖 $('.xiaPc.containerAddBg .lastContainer_3').eq(0).find('.resolveInner img').attr('src',src+'lastFooterImg_1.jpg'); $('.xiaPc.containerAddBg .lastContainer_3').eq(1).find('.resolveInner img').attr('src',src+'lastFooterImg_2.jpg'); $('.xiaPc.containerAddBg .lastContainer_3').eq(2).find('.resolveInner img').attr('src',src+'lastFooterImg_3.jpg'); // $(".bannerImg").attr("src",src+"banner_1.jpg") $(".bannerImg").attr("src",src+"index-banner-pc.jpg") $(".bannerImg").show() }else{ $('.halfChangeAllAdd .tendencyBox').eq(0).find('img').attr('src',src+'tendencyImgMBL_5.jpg'); $('.halfChangeAllAdd .tendencyBox').eq(1).find('img').attr('src',src+'tendencyImgMBL_6.jpg'); // 淇敼搴曢儴鍥剧墖 $('.xiaPc.containerAddBg .lastContainer_3').eq(0).find('.resolveInner img').attr('src',src+'lastFooterImgMBL_1.jpg'); $('.xiaPc.containerAddBg .lastContainer_3').eq(1).find('.resolveInner img').attr('src',src+'lastFooterImgMBL_2.jpg'); $('.xiaPc.containerAddBg .lastContainer_3').eq(2).find('.resolveInner img').attr('src',src+'lastFooterImgMBL_3.jpg'); //$(".bannerImg").attr("src",src+"indexBannerMbl.jpg") // $(".bannerImg").attr("src",'images/BannerMBl_2.jpg') if ($(".bannerImg").attr('data-attr') === 'v1') { $(".bannerImg").attr("src",src+"index-banner-mb.jpg") } else { $(".bannerImg").attr("src",src+"index-banner-mb_v2_01.jpg") } $(".bannerImg").show() } if($(window).width()<770){ $('.df-txt').html('寮曢鍒涙柊绉戞妧
鍏变韩鏅烘収鐗╄仈') } } function isIE() { //ie? if (!!window.ActiveXObject || "ActiveXObject" in window) return true; else return false; } function isPc(){ var winWidth=""; if (window.innerWidth){ winWidth = window.innerWidth; }else if ((document.body) && (document.body.clientWidth)){ winWidth = document.body.clientWidth; } if(winWidth>768){ return true; } return false; } var maxW = $(".device").width(); setTimeout(function(){ $(".animateInner").width((maxW-40)/3); $(".animateBox").height($(".hotActivityInner").height()+4); },100) ;(function(){ //瑙嗛璋冩暣 // var poster = document.getElementById('videoPoster'); if($('.bannerPc #videoallIndex').length > 0 && !$('body').hasClass('ie8') && !$('body').hasClass('ie7')){ var videoIndex = document.getElementById('videoallIndex'); if (ThisIsPC()) { // $('.bannerImg').hide(); $('#videoallIndex').show(); videoIndex.play() } } /*var w = $(window).width(); var h = Math.floor(w / ( 2768 / 720 )); var poster = document.getElementById('videoPoster'); if (!poster) return; if (ThisIsPC()) { $('.banner').css('height', h + 'px'); } $('.banner').show(); var timer1 = setInterval(function() { if (poster.complete) { //瑙嗛璋冩暣 if($('.bannerPc #videoallIndex').length > 0 && !$('body').hasClass('ie8') && !$('body').hasClass('ie7')){ var videoIndex = document.getElementById('videoallIndex'); if (ThisIsPC()) { $('.bannerImg').hide(); $('#videoallIndex').show(); videoIndex.play() } } clearInterval(timer1) } }, 50)*/ })() })