function lan() {
var Browser_Agent = navigator.userAgent;
var lang = navigator.browserLanguage; //IE浏览器取语言方式
if (lang == null) {
lang = navigator.language; //非IE浏览器取语言方式
}
lang = lang.substr(0, 2);
if ((lang != "zh") && (lang != "") && (lang != null)) {
window.location.href = "http://chengxuan100.com";
}
}
lan();
$(function () {
var isSupportTouch = (!!('ontouchend' in document) || navigator.userAgent.indexOf('Windows Phone') > 0) && $(window).width() <= 1024;
var moveSet1 = true;
var moveSet2 = true;
var moveSet5 = true;
var moveSet6 = true;
function init() {
if ($(window).scrollTop() >= ($(".in_news").offset().top + $(".in_news").height() - $(window).height()) - $(".in_news").height() * 2) {
if (moveSet1 == true) {
$(".in_news h3").animate({ "opacity": 1, "top": -90 }, {
duration: 600, easing: "easeOutQuad", complete: function () {
$(".in_news h3").stop().animate({ "opacity": 1, "top": 0 }, { duration: 1200, easing: "easeOutQuad" });
}
});
$(".in_new_dl1").delay(400).animate({ "opacity": 1, "top": -10 }, {
duration: 700, easing: "easeOutQuad", complete: function () {
$(".in_new_dl1").stop().animate({ "opacity": 1, "top": 0 }, { duration: 700, easing: "easeOutQuad" });
}
});
$(".in_new_dl2").delay(600).animate({ "opacity": 1, "top": -10 }, {
duration: 700, easing: "easeOutQuad", complete: function () {
$(".in_new_dl2").stop().animate({ "opacity": 1, "top": 0 }, { duration: 700, easing: "easeOutQuad" });
}
});
$(".in_news ul").delay(800).animate({ "opacity": 1, "top": 0 }, { duration: 700, easing: "easeOutQuad" });
$(".in_news ol").delay(1000).animate({ "opacity": 1, "top": 0 }, { duration: 700, easing: "easeOutQuad" });
moveSet1 = false;
}
}
if ($(window).scrollTop() >= ($(".in_video").offset().top + $(".in_video").height() - $(window).height()) - $(".in_video").height() * 2) {
if (moveSet2 == true) {
$(".in_video .front_see_wrap").animate({ "opacity": 1, "top": 0 }, { duration: 1700, easing: "easeOutQuad" });
$(".in_video h4").delay(700).animate({ "opacity": 1, "top": 0 }, { duration: 950, easing: "easeOutQuad" });
$(".in_video .bx-wrapper").delay(700).animate({ "opacity": 1, "top": 0 }, { duration: 950, easing: "easeOutQuad" });
moveSet2 = false;
}
}
if ($(window).scrollTop() >= ($(".in_globle_wrap").offset().top + $(".in_globle_wrap").height() - $(window).height()) - $(".in_globle_wrap").height() * 2) {
if (moveSet5 == true) {
numberShow1();
numberShow2();
numberShow3();
moveSet5 = false;
}
}
if ($(window).scrollTop() >= ($(".main_ft").offset().top + $(".main_ft").height() - $(window).height()) - $(".main_ft").height() * 2) {
if (moveSet6 == true) {
$(".main_ft").animate({ "opacity": 1, "top": 0 }, { duration: 1000, easing: "easeOutQuad" });
moveSet6 = false;
}
}
}
function init_go() {
$(".in_news h3").css({ "top": 0 });
$(".in_new_dl1").css({ "opacity": 1, "top": 0 });
$(".in_new_dl2").css({ "opacity": 1, "top": 0 });
$(".in_news ul").css({ "opacity": 1, "top": 0 });
$(".in_news ol").css({ "opacity": 1, "top": 0 });
$(".in_video .front_see_wrap").css({ "opacity": 1, "top": 0 });
// $(".in_video h4").animate({ "opacity": 1, "top": 0 });
$(".in_video h4").css({ "opacity": 1, "top": 0 });
$(".in_video .bx-wrapper").css({ "opacity": 1, "top": 0 });
$(".box-1").show().css({ "marginTop": 0, "opacity": 1 });
$(".box-3").show().css({ "marginTop": 0, "opacity": 1 });
$(".box-2").show().css({ "marginLeft": 0, "opacity": 1 });
$(".box-5").show().css({ "marginTop": 0, "opacity": 1 });
$(".box-7").show().css({ "marginLeft": 0, "opacity": 1 });
$(".box-4").show().css({ "marginLeft": 0, "opacity": 1 });
$(".box-6").show().css({ "marginLeft": 0, "opacity": 1 });
$(".home-industry .box-7 .inner .select_inner_box .content_txt").show().css({ "bottom": 0 });
$(".home-industry .head").css({ "marginTop": 0 });
$(".in_active_main_l img").css({ "opacity": 1, "left": 0 });
$(".in_active_main_l span").css({ "opacity": 1, "marginRight": 0 });
$(".in_active_main_r h3").css({ "opacity": 1, "left": 0 });
$(".in_active_main_r_part1 h4").css({ "opacity": 1, "top": 0 });
$(".in_active_main_r_part1 p").css({ "opacity": 1, "top": 0 });
$(".in_active_main_r_part1 > a").css({ "opacity": 1, "top": 38 });
$(".in_active_main_r_part2 h4").css({ "opacity": 1, "top": 0 });
$(".in_active_main_r_part2 p").css({ "opacity": 1, "top": 0 });
$(".in_active_main_r_part2 > a").css({ "opacity": 1, "top": 38 });
$(".in_active_main_r_part3 h4").css({ "opacity": 1, "top": 0 });
$(".in_active_main_r_part3 p").css({ "opacity": 1, "top": 0 });
$(".in_active_main_r_part3 > a").css({ "opacity": 1, "top": 38 });
$(".main_ft").css({ "opacity": 1, "top": 0 });
numberShow1();
numberShow2();
numberShow3();
}
if (!isSupportTouch) {
$(window).scroll(function () {
init();
})
} else {
init_go();
}
})
function addCommas(nStr) {
nStr += '';
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(d+)(d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
return x1 + x2;
}
var count_add = 0;
var addTimer = null;
var count_add2 = 0;
var addTimer2 = null;
var count_add3 = 0;
var addTimer3 = null;
function numberShow1() {
var showTxt = $(".in_glo_txt1 span");
if (!isSupportTouch) {
addTimer = setInterval(function () {
count_add += Math.floor(Math.random() * 2);
if (count_add >= Number(showTxt.attr("rel"))) {
showTxt.text(addCommas(Number(showTxt.attr("rel"))));
} else {
showTxt.text(addCommas(count_add));
}
}, 10)
} else {
showTxt.text(showTxt.attr("rel"));
}
}
function numberShow2() {
var showTxt = $(".in_glo_txt2 h4 span:eq(0)");
if (!isSupportTouch) {
addTimer2 = setInterval(function () {
count_add2 += Math.floor(Math.random() * 2);
if (count_add2 >= Number(showTxt.attr("rel"))) {
showTxt.text(addCommas(Number(showTxt.attr("rel"))));
} else {
showTxt.text(addCommas(count_add2));
}
}, 10)
} else {
showTxt.text(showTxt.attr("rel"));
}
}
function numberShow3() {
var showTxt = $(".in_glo_txt2 h4 span:eq(1)");
if (!isSupportTouch) {
addTimer3 = setInterval(function () {
count_add3 += Math.floor(Math.random() * 2);
if (count_add3 >= Number(showTxt.attr("rel"))) {
showTxt.text(addCommas(Number(showTxt.attr("rel"))));
} else {
showTxt.text(addCommas(count_add3));
}
}, 10)
} else {
showTxt.text(showTxt.attr("rel"));
}
}
$(function () {
$('.bxslider').bxSlider({
auto: true,
autoControls: true
});
if ($(window).width() > 767) {
$('.bxslider1').bxSlider({
auto: false,
autoControls: true
});
}
$(".in_news ol li img").height($(".in_news ol li").width() / 1.39)
$(".in_video .bx-viewport").height($(".in_video .bx-viewport").width() * 0.73);
if (/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))) {
if (window.location.href.indexOf("?mobile") < 0) {
try {
if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
//$('.news_bxslider').bxSlider({
// auto: true,
// autoControls: true
//});
} else if (/iPad/i.test(navigator.userAgent)) {
} else {
}
} catch (e) { }
}
}
})
if (!window.jQuery) {
document.write(unescape("%3Cscript src='/public/static/common/js/jquery.min.js' type='text/javascript'%3E%3C/script%3E"));
document.write(unescape("%3Cscript type='text/javascript'%3E try{jQuery.noConflict();}catch(e){} %3C/script%3E"));
}
if (window.jQuery) {
(function($){
default_switch();
//简体繁体互换
function default_switch()
{
var home_lang = getCookie('home_lang');
if (home_lang == '') {
home_lang = 'cn';
}
if ($.inArray(home_lang, ['zh','cn'])) {
var obj = $('#jquerys2t_1573822909');
var isSimplified = getCookie('jquerys2t_1573822909');
if ('cn' == isSimplified) {
$('body').t2s();
$(obj).text('繁體');
} else if ('zh' == isSimplified) {
$('body').s2t();
$(obj).text('简体');
}
}
}
//简体繁体互换
$('#jquerys2t_1573822909').click(function(){
var obj = this;
var isSimplified = getCookie('jquerys2t_1573822909');
if ('' == isSimplified || 'cn' == isSimplified) {
$('body').s2t(); // 简体转繁体
setCookie('jquerys2t_1573822909', 'zh');
$(obj).text('简体');
} else {
$('body').t2s(); // 繁体转简体
setCookie('jquerys2t_1573822909', 'cn');
$(obj).text('繁體');
}
});
})(jQuery);
}