$(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 = "";
//行业实践下面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()-0;
var basewidth=($(".containerinnerbox").width()-0)/3;
if(isie()){
$(".containerh3").addclass("containerh3isie");
}
$(window).resize(function(){
maxwidth=$(".containerinnerbox").width()-0;
basewidth=($(".containerinnerbox").width()-0)/3;
$(".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);
//解决方案划过效果
$(".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_01.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",'http://qxu1590930352.my3w.com/3/images/h3c/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.gif")
}
$(".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);
$('.footerinnerright').html('版权所有 2019-'+ (new date().getfullyear()) +' 珠海全视通信息技术有限公司.保留一切权利.粤icp备14005313号')
},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)*/
})()
})