$(function() {
var p_W = window.innerWidth;
var p_H = window.innerHeight;
/*页面滚动加载动画*/
//new WOW().init();
var wow = new WOW({
boxClass: 'wow',
animateClass: 'animated',
offset: 0,
mobile: true,
live: true
});
wow.init();
/*尾部二维码鼠标移入呼出*/
$(".weChat_qq a.weChat").hover(function(){
$(".weChat_qq .qr_code").fadeIn(200).addClass("on");
},function(){$(".weChat_qq .qr_code").fadeOut(200).removeClass("on");});
if(p_W < 480){$(".weChat_qq .qr_code h6").html("长按识别二维码");$(".header .nav ul").prepend('
首页');$("#submit").val("提交");}
/*内页banner标题*/
$(".banners .banners_text").addClass("animated bounceInUp");
/*内岩页二级分类导航点击切换*/
$(".programmeList_navBox dl dd").on("click",function(){
$(this).addClass("cur").siblings().removeClass("cur");
});
/*首页观看视频*/
var myVideo=document.getElementById("videos");
$(".videoText .videoText_box span").on("click",function(){
$("#video").fadeIn().addClass("on");
$("#video video").attr("src",$(this).data("src"));
myVideo.play();
});
$("#videoClose").on("click",function(){
$("#video").fadeOut().removeClass("on");
myVideo.pause();
});
$("#videos").on("click",function(){
if(myVideo.paused){
myVideo.play();
}else{
myVideo.pause();
}
});
/*关于我们数额滚动*/
var isNum = false;//关于我们数额只增加一次
$(window).on("load scroll",function(){
/*图文垂直方向居中*/
$(".programmeDetails_one .one_right").css("paddingTop",($(".programmeDetails_one").height()-$(".programmeDetails_one .one_right").height())*.5);
$("ul.programme_box li .text").css("paddingTop",($("ul.programme_box li .img").height()-$("ul.programme_box li .text").height())*.5);
$(".news_box .text").css("paddingTop",($(".news_box ul li").height()-$(".news_box .text").height())*.5);
$(".about_one .one_left").height($(".about_one").height());
var _scrollTop=$(window).scrollTop();
if(_scrollTop >= 50){
$("#header").addClass("gray");
}else{
$("#header").removeClass("gray");
}
/*所有页面滚动内容淡出加载*/
var allDom = $(".about_one,.space_one,.space_two,.space_three,.space_five,.idea_one,.exhibition_one ul li,ul.programme_box li,.news_box ul li,.newsBox .news_lately,.service_box,.contact_box,.message_one,.recruit_box,.home_two,.home_three,.home_four,.home_five");
allDom.each(function(){
if(p_H + _scrollTop >= $(this).offset().top + 100){$(this).addClass("on");}
});
$("#consultation ul li").each(function(){
if(_scrollTop >= 300){$(this).addClass("on");}else{$(this).removeClass("on");}
});
/*关于我们数字动态增加*/
if (!isNum && $(".about_two").html()) {
if(p_H + _scrollTop >= $(".about_two").offset().top + 100){
isNum = true;
$(".about_two ul li h3 span").each(function(){
var autoSet = null;
var i = 0;
var j = $(this).html();
var _self = $(this);
function autoNum(){
_self.html(i++);
if(i>j){clearInterval(autoSet);}
}
autoSet = setInterval(autoNum,20)
});}
}
});
/*服务支持点击*/
$(".service_box ul li").on("click",function(){
if($(this).hasClass("on")){
$(this).removeClass("on");
}else{
$(this).addClass("on");
}
});
/*$(".service_box ul li .liText").on("click",function(){
if(!$(this).parents(".service_box").hasClass("download_box")){
$(this).parents("li").removeClass("on");
}
}); */
/*联系我们--加入我们鼠标移入自动滚动*/
if(p_W >= 960){
$(".recruit_box ul li .scroll").each(function(){
var _self = $(this);
var scrollUp,scrollDown;
_self.hover(function(){
clearInterval(scrollDown);
var _st = _self.scrollTop();
function auto(){_self.scrollTop(_st++);}
scrollUp = setInterval(auto,20);
},function(){
clearInterval(scrollUp);
var _st = _self.scrollTop();
function auto2(){_self.scrollTop(_st--);}
scrollDown = setInterval(auto2,10);
});
});
}else{
$(".recruit_box ul li .scroll").on("click",function(){
$(this).toggleClass("on");
});
}
/*网页加载进度条*/
/* $("#svg .progress_bar").animate({"stroke-dashoffset":"100"},500);
var progress_x=0;
var progress_one=setInterval(function(){
$(".loadings p").html(progress_x++ +"%");
if(progress_x==81){clearInterval(progress_one);}
},6.25);
document.onreadystatechange=loadingChange;
function loadingChange(){
if(document.readyState="complete"){
setTimeout(function(){
$("#svg .progress_bar").animate({"stroke-dashoffset":"0"},500);
var progress_two=setInterval(function(){
$(".loadings p").html(progress_x++ +"%");
if(progress_x>100){clearInterval(progress_two);$(".loadings").fadeOut();}
},25);
},500);
}
}*/
});