// 闃绘娴忚鍣ㄦ鐨瓔鏁堟灉
document.addeventlistener('touchmove', function (e) {
e.preventdefault(); //闃绘榛樿鐨勫鐞嗘柟寮�(闃绘涓嬫媺婊戝姩鐨勬晥鏋�)
}, {passive: false}); //passive 鍙傛暟涓嶈兘鐪佺暐锛岀敤鏉ュ吋瀹筰os鍜宎ndroid
// 闃绘body鍐掓场
document.body.addeventlistener('touchmove', function (e) {
e.stoppropagation();
});
// 鍔犺浇鍔ㄧ敾鍏冪礌鐖剁骇璁剧疆鐩稿瀹氫綅锛屾孩鍑洪殣钘�
$('.blackinout,.blackout,.whiteout').parent().css({"position":"relative","overflow":"hidden"});
// 绛夐珮
// var mheight = settimeout(function(){
// $('.c-dg').matchheight();
// cleartimeout(mheight);
// },50);
// 榧犳爣绉诲叆瀵艰埅鏁堟灉
headhover();
function headhover(){
var h = $("#c-header");
var ali = $("#c-header .c-nav li");
var aitem1 = $("#c-header .c-nav li .c-list1 .c-item");
var aitem2 = $("#c-header .c-nav li .c-list2 .c-item");
var num = 0;
h.hover(function(){
$(this).addclass("c-head-hide");
},function(){
if($(window).scrolltop()<50 && $("#c-placeholder").length==0){
$(this).removeclass("c-head-hide");
}
});
ali.hover(function(){
$(this).find(".c-list-box").css({"display":"block","opacity":"0"});
$(this).find(".c-list-box").stop().animate({"top":"82px","opacity":"1"},500);
},function(){
if($("#c-placeholder").length==0 && $(window).scrolltop()<50){
$(this).find(".c-list-box").stop().animate({"top":"100px","opacity":"0"},500,function(){
$(this).css({"display":"none"});
});
}else{
$(this).find(".c-list-box").stop().animate({"top":"82px","opacity":"0"},500,function(){
$(this).css({"display":"none"});
});
}
});
fn1();
aitem1.hover(function(){
num = $(this).index();
fn1();
});
function fn1(){
aitem1.removeclass("active");
aitem1.eq(num).addclass("active");
aitem2.removeclass("active");
aitem2.eq(num).addclass("active");
}
};
// 瀵艰埅
cnav();
function cnav(){
var obody = $("body");
var onav = $("#c-header .c-nav");
var obtn = $("#c-header .c-switch");
var ol = $("#c-header .c-nav li");
var oa = $("#c-header .c-nav2 a");
var num = 0;
obtn.click(function(){
obody.toggleclass('c-open');
});
$(window).resize(function(){
if ($("#c-header .c-nav").css("display") == "block") {
obody.removeclass("c-open");
}
});
ol.hover(function(){
$(this).children("ul").stop().slidetoggle();
},function(){
$(this).children("ul").stop().slidetoggle();
});
oa.click(function(){
$(this).next().slidetoggle();
});
ol.each(function(){
if($(this).hasclass("active")){
num = $(this).index();
}
$(this).hover(function(){
ol.eq(num).removeclass("active");
},
function(){
ol.eq(num).addclass("active");
});
});
}
// 椤堕儴璇█銆佹悳绱�
topmove();
function topmove(){
var obtn1 = $("#c-header .c-nav .c-language>a");
var obtn2 = $("#c-header .c-nav .c-search-box>a");
var olist1 = $("#c-header .c-nav .c-language .c-list");
var olist2 = $("#c-header .c-nav .c-search-box form");
var obutton = $("#c-header .c-nav .c-search-box form button");
obtn1.click(function(e){
e.stoppropagation();
olist1.stop().fadetoggle();
olist2.stop().fadeout();
});
obtn2.click(function(e){
e.stoppropagation();
olist2.stop().fadetoggle();
olist1.stop().fadeout();
});
olist2.click(function(e){
e.stoppropagation();
});
$("html,body").click(function(){
olist2.stop().fadeout();
olist1.stop().fadeout();
});
}
// 棣栭〉杞挱
banner1();
function banner1(){
var swiper = new swiper('.c-banner1', {
speed:1000,
autoplay : {
delay:4000,
disableoninteraction: false,
},
effect : 'fade',
pagination: {
el: '.c-banner1 .swiper-pagination',
clickable :true,
renderbullet: function (index, classname) {
return '
';
},
},
});
}
// 浼欎即杞挱
banner2();
function banner2(){
var swiper = new swiper('.c-banner2', {
slidesperview: 5,
slidespergroup : 5,
slidespercolumn: 2,
spacebetween: 15,
autoplay: true,
pagination: {
el: '.c-banner2 .swiper-pagination',
clickable :true,
},
breakpoints: {
500:{
slidesperview: 2,
slidespergroup : 2,
},
768:{
slidesperview: 4,
slidespergroup : 4,
}
}
});
}
// 浼欎即杞挱
banner3();
function banner3(){
var swiper = new swiper('.c-banner3', {
slidesperview: 3,
autoplay: true,
breakpoints: {
700:{
slidesperview: 1,
slidespergroup : 1,
},
992:{
slidesperview: 2,
slidespergroup : 2,
}
}
});
}
// 棰嗗鑷磋緸
banner4();
function banner4(){
var swiper = new swiper('.c-banner4', {
slidesperview: 1,
loop:true,
navigation: {
nextel: '.c-banner4 .swiper-button-next',
prevel: '.c-banner4 .swiper-button-prev',
},
});
}
profile2();
function profile2(){
var swiper = new swiper('#c-profile2 .c-text', {
direction: 'vertical',
slidesperview: 'auto',
freemode: true,
scrollbar: {
el: '#c-profile2 .c-text .swiper-scrollbar',
},
mousewheel: true,
});
}
// 鍏徃绠€浠�
profile1();
function profile1(){
var swiper = new swiper('#c-profile1 .swiper-container', {
direction: 'vertical',
slidesperview: 'auto',
freemode: true,
scrollbar: {
el: '#c-profile1 .swiper-scrollbar',
},
mousewheel: true,
});
}
// 鍝佽川璧勮川
banner13();
function banner13(){
var swiper = new swiper('.c-banner13',{
spacebetween: 16,
slidesperview: 4,
autoplay:true,
loop:true,
breakpoints: {
500:{
slidesperview: 1,
},
992:{
slidesperview: 2,
},
1599:{
slidesperview: 3,
}
}
});
}
// 鏂伴椈澶存潯
banner14();
function banner14(){
var swiper = new swiper('.c-banner14',{
speed:2000,
autoplay : {
delay:4000
},
effect : 'fade',
slidesperview: 1,
autoplay:true,
loop:true,
navigation: {
nextel: '.c-banner14 .swiper-button-next',
prevel: '.c-banner14 .swiper-button-prev',
}
});
}
// 鍩哄湴鐜
banner15();
function banner15(){
var swiper = new swiper('.c-banner15',{
spacebetween: 62,
slidesperview: 1,
loop:true,
pagination: {
el: '.c-banner15 .swiper-pagination',
clickable :true,
},
navigation: {
nextel: '.c-banner15 .swiper-button-next',
prevel: '.c-banner15 .swiper-button-prev',
}
});
var bannerwrap = $("#c-banner15-wrap");
var banner = $(".c-banner15");
var btn = $("#c-banner15-wrap .c-btn");
var ali = $("#c-base5 .c-list li");
var adot = $(".c-banner15 .swiper-pagination span");
ali.click(function(){
bannerwrap.toggleclass("active");
adot.eq($(this).index()).click();
});
bannerwrap.click(function(){
bannerwrap.toggleclass("active");
});
banner.click(function(event){
event.stoppropagation();
});
}
// 鍙鍖栨暟鎹粴鍔�
visualdata($(".c-vdata"));
function visualdata(obj){
$(window).load(function(){
obj.each(function(){
var h = number($(this).html());
var t = "";
var n = math.ceil(h/20);
var a = true;
var this = $(this);
if($(this).length!=0){
t = $(this).offset().top;
}
this.html(0);
fn1();
$(window).scroll(function(){
fn1();
});
function fn1(){
var wt = $(window).scrolltop();
if(wt>t-$(window).height()+50 && wt=h) {
y = h;
clearinterval(timer2);
}
this.html(y);
y+=n;
},100);
}
}
});
});
}
// 瀵艰埅鏄剧ず
navfade();
function navfade(){
var i = $(window).scrolltop();
var obj = $("#c-header");
$(window).scroll(function(){
if($(this).scrolltop()>i && $(this).scrolltop()>50){
i = $(this).scrolltop();
obj.addclass("c-head-move");
}else{
i = $(this).scrolltop();
obj.removeclass("c-head-move");
}
});
}
// 椤甸潰婊氬姩闅愯棌瀵艰埅
isscroll();
function isscroll(){
var i = $(window).scrolltop();
var obj = $("#c-header");
if($("#c-placeholder").length!=0){
obj.addclass("c-head-hide");
}else{
fn1();
$(window).scroll(function(){
i = $(this).scrolltop();
fn1();
});
}
function fn1(){
if(i>50){
obj.addclass("c-head-hide");
}else{
obj.removeclass("c-head-hide");
}
}
}
// 瑙嗛鎾斁
videoplay();
function videoplay(){
var ov1 = $("#c-about .c-right-box .c-video1");
var oplay = $("#c-about .c-right-box .c-play");
var ov2 = $("#c-video-box .c-video2");
var oclose = $("#c-video-box .c-btn");
var ovbox = $("#c-video-box");
var surl = ov1.attr("src");
var vt = null;
ov1.delay(10).attr("src",surl);
if(ov1.length!=0){
vt = ov1.offset().top;
}
$(window).scroll(function(){
if($(this).scrolltop()>vt-$(window).height()*0.5 && $(this).scrolltop()vt-$(window).height()*0.5 && $(this).scrolltop()li");
if($(window).width()<=500){
ali.each(function(){
var this = $(this);
$(this).find(".c-title-box").click(function(){
this.toggleclass("active");
this.find(".c-list").stop().slidetoggle();
});
});
}
}
// 鐐瑰嚮搴曢儴寰俊寮瑰嚭浜岀淮鐮�
weixin();
function weixin(){
var b = $("#c-footer .c-wx-btn");
var w = $("#c-footer .c-weixin");
var d = w.find(".c-img-box");
b.click(function(){
w.stop().fadetoggle();
});
d.click(function(){
return false;
});
w.click(function(){
w.stop().fadetoggle();
});
}
// 浜у搧涓嬫媺鍔ㄧ敾
productslide();
function productslide(){
var ali = $("#c-product4 .c-left-box .c-list li");
ali.each(function(){
if($(this).hasclass("active")){
$(this).children("ul").stop().slidedown();
}
});
ali.click(function(e){
e.stoppropagation();
$(this).children("ul").stop().slidetoggle();
$(this).toggleclass("active");
})
}
// 鑱旂郴鎴戜滑琛ㄥ崟
formtab();
function formtab(){
var ali1 = $("#c-contact .c-list1>li");
var ali2 = $("#c-contact .c-list2>li");
var i = 0;
fn1();
ali1.click(function(){
i = $(this).index();
fn1();
});
function fn1(){
ali1.removeclass("active");
ali1.eq(i).addclass("active");
ali2.removeclass("active");
ali2.eq(i).addclass("active");
}
}
// 鍦板浘鍒囨崲
maptab();
function maptab(){
var ali1 = $("#c-contact2 .c-list1>li");
var ali2 = $("#c-contact2 .c-list2>li");
var i = 0;
fn1();
ali1.click(function(){
i = $(this).index();
fn1();
});
function fn1(){
ali1.removeclass("active");
ali1.eq(i).addclass("active");
ali2.removeclass("active");
ali2.eq(i).addclass("active");
}
ali2.each(function(){
var ap = $(this).find(".c-left-box .c-link p");
var at = $(this).find(".c-left-box .c-text-box .c-item");
var am = $(this).find(".c-right-box .c-map");
var a = 0;
fn2();
ap.click(function(){
a = $(this).index();
fn2();
});
function fn2(){
ap.removeclass("active");
ap.eq(a).addclass("active");
at.removeclass("active");
at.eq(a).addclass("active");
am.removeclass("active");
am.eq(a).addclass("active");
}
});
}
// 鎷涜仒
join();
function join(){
var ali = $("#c-join3 .c-list2>li");
ali.each(function(){
var this = $(this);
$(this).find(".c-title-box").click(function(){
this.toggleclass("active");
this.find(".c-text-wrap").stop().slidetoggle();
});
});
}
function go1(){
$("html,body").animate({"scrolltop":$("#c-join").offset().top-40});
}
function go2(){
$("html,body").animate({"scrolltop":$("#c-join3").offset().top});
}
function go3(){
$("html,body").animate({"scrolltop":$("#c-join4").offset().top});
}
// 渚ц竟鏍忓洖鍒伴《閮�
gotop();
function gotop(){
var atop = $("#c-go-top");
atop.click(function(){
$('html,body').animate({scrolltop:0},500);
});
$(window).scroll(function(){
var i = $(this).scrolltop();
if (i > $('html').outerheight()-$(this).height()-$(this).height()*0.5) {
atop.fadein(500);
}else{
atop.fadeout(500);
}
});
}
// 鏂囦欢閫夋嫨
function showfile (e, ele) {
var fullfilename = e.target.value;
fullfilename = fullfilename.split('\\');
filename = fullfilename[fullfilename.length-1];
$(ele).parent().find(".c-text").text("宸查€夋嫨锛�" + filename);
$(ele).parents("form").find("[name='filesubmit']").show();
}
// 绠€鍘嗗脊绐�
function fixedpop(str){
$("#category4").val(str);
$("#c-fixed-pop").stop().fadein();
}
$("#c-fixed-pop .c-close").click(function(event){
event.stoppropagation();
$("#c-fixed-pop").stop().fadeout();
});
$("#c-fixed-pop").click(function(){
$("#c-fixed-pop").stop().fadeout();
});
$("#c-fixed-pop form").click(function(event){
event.stoppropagation();
});
// 椤甸潰杩涘叆鍔ㄧ敾
// (function($) {
// function wow() {
// var t = .1,
// e = !0,
// wow = new wow({
// boxclass: "wow",
// animateclass: "animated",
// offset: 0,
// callback: function(e) {
// (e = $(e)).css("animation-delay", t.tofixed(1) + "s"),
// t += .1;
// } (function($) {
// function wow() {
// var t = .1,
// e = !0,
// wow = new wow({
// boxclass: "wow",
// animateclass: "animated",
// offset: 0,
// callback: function(e) {
// (e = $(e)).css("animation-delay", t.tofixed(1) + "s"),
// t += .1;
// }
// });
// $(window).scroll(function() {
// e && (t = .2, settimeout(function() {
// e = !0
// }, 150), e = !1)
// }),
// wow.init();
// }
// wow();
// }(jquery));
// });
// $(window).scroll(function() {
// e && (t = .2, settimeout(function() {
// e = !0
// }, 150), e = !1)
// }),
// wow.init();
// }
// wow();
// }(jquery));
// 杩愬姩鏇茬嚎
$.extend(jquery.easing , {
easein: function(x,t, b, c, d){ //鍔犻€熸洸绾�
return c*(t/=d)*t + b; },
easeout: function(x,t, b, c, d){ //鍑忛€熸洸绾�
return -c *(t/=d)*(t-2) + b; },
easeboth: function(x,t, b, c, d){ //鍔犻€熷噺閫熸洸绾�
if ((t/=d/2) < 1) { return c/2*t*t + b; } return -c/2 * ((--t)*(t-2) - 1) + b; },
easeinstrong: function(x,t, b, c, d){ //鍔犲姞閫熸洸绾�
return c*(t/=d)*t*t*t + b; },
easeoutstrong: function(x,t, b, c, d){ //鍑忓噺閫熸洸绾�
return -c * ((t=t/d-1)*t*t*t - 1) + b; },
easebothstrong: function(x,t, b, c, d){ //鍔犲姞閫熷噺鍑忛€熸洸绾�
if ((t/=d/2) < 1) { return c/2*t*t*t*t + b; } return -c/2 * ((t-=2)*t*t*t - 2) + b; },
elasticin: function(x,t, b, c, d, a, p){ //姝e鸡琛板噺鏇茬嚎锛堝脊鍔ㄦ笎鍏ワ級
if (t === 0) { return b; } if ( (t /= d) == 1 ) { return b+c; } if (!p) { p=d*0.3; } if (!a || a < math.abs(c)) { a = c; var s = p/4; } else { var s = p/(2*math.pi) * math.asin (c/a); } return -(a*math.pow(2,10*(t-=1)) * math.sin( (t*d-s)*(2*math.pi)/p )) + b; },
elasticout: function(x,t, b, c, d, a, p){ //姝e鸡澧炲己鏇茬嚎锛堝脊鍔ㄦ笎鍑�
if (t === 0) { return b; } if ( (t /= d) == 1 ) { return b+c; } if (!p) { p=d*0.3; } if (!a || a < math.abs(c)) { a = c; var s = p / 4; } else { var s = p/(2*math.pi) * math.asin (c/a); } return a*math.pow(2,-10*t) * math.sin( (t*d-s)*(2*math.pi)/p ) + c + b; },
elasticboth: function(x,t, b, c, d, a, p){ if (t === 0) { return b; } if ( (t /= d/2) == 2 ) { return b+c; } if (!p) { p = d*(0.3*1.5); } if ( !a || a < math.abs(c) ) { a = c; var s = p/4; } else { var s = p/(2*math.pi) * math.asin (c/a); } if (t < 1) { return - 0.5*(a*math.pow(2,10*(t-=1)) * math.sin( (t*d-s)*(2*math.pi)/p )) + b; } return a*math.pow(2,-10*(t-=1)) * math.sin( (t*d-s)*(2*math.pi)/p )*0.5 + c + b; },
backin: function(x,t, b, c, d, s){ //鍥為€€鍔犻€燂紙鍥為€€娓愬叆锛�
if (typeof s == 'undefined') { s = 1.70158; } return c*(t/=d)*t*((s+1)*t - s) + b; },
backout: function(x,t, b, c, d, s){ if (typeof s == 'undefined') { s = 3.70158; //鍥炵缉鐨勮窛绂�
} return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; },
backboth: function(x,t, b, c, d, s){ if (typeof s == 'undefined') { s = 1.70158; } if ((t /= d/2 ) < 1) { return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; } return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; },
bouncein: function(x,t, b, c, d){ //寮圭悆鍑忔尟锛堝脊鐞冩笎鍑猴級
return c - this['bounceout'](x,d-t, 0, c, d) + b; },
bounceout: function(x,t, b, c, d){ if ((t/=d) < (1/2.75)) { return c*(7.5625*t*t) + b; } else if (t < (2/2.75)) { return c*(7.5625*(t-=(1.5/2.75))*t + 0.75) + b; } else if (t < (2.5/2.75)) { return c*(7.5625*(t-=(2.25/2.75))*t + 0.9375) + b; } return c*(7.5625*(t-=(2.625/2.75))*t + 0.984375) + b; },
bounceboth: function(x,t, b, c, d){ if (t < d/2) { return this['bouncein'](x,t*2, 0, c, d) * 0.5 + b; } return this['bounceout'](x,t*2-d, 0, c, d) * 0.5 + c*0.5 + b; }
});