/* * JS鍩虹澶勭悊妗嗘灦 * -- 鎻愬€′簰鑱旂綉鍏变韩,鍚屾椂搴斿皧閲嶅師鍒涗綔鑰?缃戠珯鍒朵綔灞濟 鐖变紒浜 -- * * @company: iqweb * @author: jack * timer: 2021骞 * Tel锛?8565633435 * QQ锛?97232289 * WeChat锛?8565633435 */ var IqwXiongJs = { Width: $(window).width(), Height: $(window).height(), //閿氱偣璺濈 maoNumber: 0, //鏁板瓧婊氬姩鍒ゆ柇 NumberIf: true, Number: [], //鏈夐敋鐐规墠鍚搁《 maoTop: false, WapNavIF: true, bannerAnimation: 'AddFadeInUp', //婊氬姩鏉 MyScroll: null, //鍔犺浇 ImagesLoad: false, SvgTimeOver: null, SvgTime: 0, ImgArray: [], allImages: [], FilterTime: null, FilterNumber: null, //澧炲姞 IndexPageTab: null, IndexBannerTab: null, IndexProTab: null, IndexNewsTab: null, AboutPageTab: null, AboutCompanyTab: null, ProPageTab: null, ContactTab: null, HeaderDownTab: null, IndexLastIf: false, AboutLastIf: false, //鏂板 //EventKey: "ontouchstart" in document.documentElement ? "touchstart" : "click", Init: function () { var that = this; that.HtmlInit(); }, //浜嬩欢 AddEventList: function () { var that = this; // console.log($(".about_message_item_box:nth-child(1) svg path").get(0).getTotalLength()); function return_false() { return false; } $('#top').on('click', function (e) { e.preventDefault(); that.ReturnTop(); }); if ($('.solution_page_content').length > 0) { $(document.body).animate({ scrollTop: $('.news_page_banner_box').height() -$('.header_wrap').height() }, 700); $('html').animate({ scrollTop: $('.news_page_banner_box').height() -$('.header_wrap').height() }, 700) } $('.index_business_item_box').hover(function (e) { e.preventDefault(); $('.index_business_item_box').eq($(this).index()).addClass('index_business_item_active').siblings().removeClass('index_business_item_active'); }); $('.index_news_li').hover(function (e) { e.preventDefault(); $('.index_news_li').eq($(this).index()).addClass('index_news_active').siblings().removeClass('index_news_active'); }); $('.header_nav_item').hover(function (e) { e.preventDefault(); $('.header_nav_item').addClass('header_nav_default').eq($(this).index()).addClass('header_nav_hover'); }, function () { $('.header_nav_item').removeClass('header_nav_default header_nav_hover'); }); $('.about_culture_item_box').hover(function () { $('.about_culture_item_box').eq($(this).index()).addClass('about_culture_item_active').siblings().removeClass('about_culture_item_active'); }); $('.news_content_nav_item').hover(function (e) { e.preventDefault(); $('.news_content_nav_item').addClass('news_content_nav_default').eq($(this).index()).addClass('news_content_nav_hover'); }, function () { $('.news_content_nav_item').removeClass('news_content_nav_default news_content_nav_hover'); }); $('.pro_banner_item_box').on('click', function (e) { e.preventDefault(); $('.pro_banner_item_box').eq($(this).index()).addClass('pro_banner_item_active').siblings().removeClass('pro_banner_item_active'); that.ProPageTab.slideTo($(this).index()); $(document.body).animate({ scrollTop: $('.pro_page_wrap').offset().top - $('.header_wrap').height() - ($('.pro_banner_list').height()) }, 700); $('html').animate({ scrollTop: $('.pro_page_wrap').offset().top - $('.header_wrap').height() - ($('.pro_banner_list').height()) }, 700) }); $('.contact_wap_item_box').on('click', function (e) { e.preventDefault(); $('.contact_wap_item_box').eq($(this).index()).addClass('contact_wap_item_active').siblings().removeClass('contact_wap_item_active'); that.ContactTab.slideTo($(this).index()); }); $('.join_post_item_box').eq(0).addClass('join_post_item_active'); $('.join_post_item_box').eq(0).find('.join_post_item_content').css({ height: $('.join_post_item_box').eq(0).find('.join_post_item_animate').height() }) $('.join_post_item_head').on('click', function (e) { e.preventDefault(); if ($(this).parents('.join_post_item_box').hasClass('join_post_item_active')) { $(this).parents('.join_post_item_box').removeClass('join_post_item_active'); $(this).parents('.join_post_item_box').find('.join_post_item_content').css({ height: 0 }) } else { $(this).parents('.join_post_item_box').addClass('join_post_item_active'); $(this).parents('.join_post_item_box').find('.join_post_item_content').css({ height: $(this).parents('.join_post_item_box').find('.join_post_item_animate').height() }) } }); $('.header_down_nav_link').hover(function (e) { e.preventDefault(); $('.header_down_nav_link').removeClass('header_down_nav_current'); $(this).addClass('header_down_nav_current') }); $('.header_nav_item').hover(function (e) { e.preventDefault(); if ($('.header_nav_item').eq($(this).index()).find('.header_down_wrap').length > 0) { $('.header_wrap').addClass('header_hover_black'); } $('.header_nav_item').eq($(this).index()).find('.header_down_wrap').css({ height: $('.header_nav_item').eq($(this).index()).find('.header_down_animate').height() }) }, function () { $('.header_wrap').removeClass('header_hover_black'); $('.header_nav_item').eq($(this).index()).find('.header_down_wrap').css({ height: 0 }) }); }, //index IndexPageSwiper: function () { var that = this; var interleaveOffset = 0.5; //瑙嗗樊姣斿€ var TouchMove = false; if (that.Width < 1200) { TouchMove = true; } that.IndexPageTab = new Swiper(".index_page_swiper", { initialSlide: 0, direction: 'vertical', slidesPerView: 'auto', //绂佹婊戝姩鏃秙wiper绉诲姩 followFinger: false, //绂佹鎵嬫寚婊戝姩 allowTouchMove: TouchMove, //榧犳爣 mousewheel: true, //閿洏 keyboard: { enabled: true, }, //鍒囨崲鏃堕棿 speed: 1000, //鍒囨崲鏃舵粦鍔ㄦ棤鏁堢洿鍒板垏鎹㈢粨鏉 preventInteractionOnTransition: true, on: { transitionStart: function () { console.log(this.realIndex); if (this.realIndex == 0) { $('.header_wrap').removeClass('header_black header_white'); } if (this.realIndex == 1) { $('.header_wrap').removeClass('header_white').addClass('header_black'); } if (this.realIndex == 2) { $('.header_wrap').removeClass('header_white').addClass('header_black'); } if (this.realIndex == 3) { $('.header_wrap').removeClass('header_white').addClass('header_black'); } if (this.realIndex == 4) { if (that.Width > 1200) { if (that.IndexLastIf) { that.IndexLastIf = false; console.log('绂诲紑鏈€鍚庝竴椤?); } else { $('.header_wrap').removeClass('header_white').addClass('header_black'); } } else { $('.header_wrap').removeClass('header_white').addClass('header_black'); } } if (this.realIndex == 5) { if (that.Width < 1200) { $('.header_wrap').removeClass('header_black header_white'); } } }, //鏈€鍚庝竴椤 reachEnd: function () { that.IndexLastIf = true; console.log('杩涘叆鏈€鍚庝竴椤?); $('.header_wrap').removeClass('header_black').addClass('header_white'); }, slideChangeTransitionEnd: function () { $('.index_page_slide').removeClass('index_page_current').eq(this.realIndex).addClass('index_page_current'); } } }); }, //About AboutPageSwiper: function () { var that = this; var interleaveOffset = 0.5; //瑙嗗樊姣斿€ var TouchMove = false; if (that.Width < 1200) { TouchMove = true; } setTimeout(function () { that.AboutPageTab = new Swiper(".about_page_swiper", { initialSlide: 0, direction: 'vertical', slidesPerView: 'auto', //绂佹婊戝姩鏃秙wiper绉诲姩 followFinger: false, //绂佹鎵嬫寚婊戝姩 allowTouchMove: TouchMove, //榧犳爣 mousewheel: true, //閿洏 keyboard: { enabled: true, }, //鍒囨崲鏃堕棿 speed: 1000, //鍒囨崲鏃舵粦鍔ㄦ棤鏁堢洿鍒板垏鎹㈢粨鏉 preventInteractionOnTransition: true, on: { init: function () { $('.header_wrap').addClass('header_black'); $('.about_page_slide').eq(0).addClass('about_page_current'); }, transitionStart: function () { console.log(this.realIndex); if (this.realIndex == 0) { $('.header_wrap').removeClass('header_white').addClass('header_black'); } if (this.realIndex == 1) { $('.header_wrap').removeClass('header_white').addClass('header_black'); } if (this.realIndex == 2) { $('.header_wrap').removeClass('header_white').addClass('header_black'); } if (this.realIndex == 3) { $('.header_wrap').removeClass('header_white').addClass('header_black'); } if (this.realIndex == 4) { $('.header_wrap').removeClass('header_white').addClass('header_black'); } if (this.realIndex == 5) { $('.header_wrap').removeClass('header_white').addClass('header_black'); } if (this.realIndex == 6) { $('.header_wrap').removeClass('header_white').addClass('header_black'); } if (this.realIndex == 7) { $('.header_wrap').removeClass('header_white').addClass('header_black'); } if (this.realIndex == 8) { if (that.Width > 1200) { if (that.AboutLastIf) { that.AboutLastIf = false; console.log('绂诲紑鍏充簬鎴戜滑鏈€鍚庝竴椤?); } else { $('.header_wrap').removeClass('header_white header_black'); } } else { $('.header_wrap').removeClass('header_white header_black'); } } if (this.realIndex == 9) { if (that.Width < 1200) { $('.header_wrap').removeClass('header_black header_white'); } } }, //鏈€鍚庝竴椤 reachEnd: function () { that.AboutLastIf = true; console.log('杩涘叆鍏充簬鎴戜滑鏈€鍚庝竴椤?); $('.header_wrap').removeClass('header_black').addClass('header_white'); }, slideChangeTransitionEnd: function () { $('.about_page_slide').removeClass('about_page_current').eq(this.realIndex).addClass('about_page_current'); that.NumberIf = true; if (this.realIndex == 5) { that.AboutNumber(); } } } }); }, 300) }, //banner IndexBannerSwiper: function () { var that = this; setTimeout(function () { that.IndexBannerTab = new Swiper(".index_banner_swiper", { effect: 'fade', loop: true, speed: 800, grabCursor: true, pagination: { el: '.index_banner_pagination', clickable: true, }, autoplay: { delay: 6000, stopOnLastSlide: false, disableOnInteraction: false, }, }); }, 300); setTimeout(function () { $('.index_banner_pagination').addClass('index_banner_show'); }, 600) }, IndexProSwiper: function () { var that = this; var aSlidesPerView = 4; if (that.Width < 1200) { aSlidesPerView = 1.1; } var aSpaceBetween = that.Width * 0.01041666; that.IndexProTab = new Swiper(".index_pro_swiper", { loop: true, speed: 800, slidesPerView: aSlidesPerView, navigation: { nextEl: ".index_pro_next", prevEl: ".index_pro_prev", }, // spaceBetween: aSpaceBetween, }); }, IndexNewsSwiper: function () { var that = this; var aSlidesPerView = 3; var aSpaceBetween = that.Width * 0.0125; if (that.Width < 1200) { aSlidesPerView = 1.2; aSpaceBetween = that.Width * 0.02415458; } that.IndexNewsTab = new Swiper(".index_news_swiper", { loop: true, speed: 800, slidesPerView: aSlidesPerView, spaceBetween: aSpaceBetween, }); }, AboutCompanySwiper: function () { var that = this; var TouchMove = false; var aSlidesPerView = 2; var aSpaceBetween = that.Width * 0.0125; if (that.Width < 1200) { TouchMove = true; aSlidesPerView = 1.8; } that.AboutCompanyTab = new Swiper(".about_company_swiper", { loop: true, speed: 800, slidesPerView: aSlidesPerView, spaceBetween: aSpaceBetween, centeredSlides: true, //绂佹婊戝姩鏃秙wiper绉诲姩 followFinger: false, //绂佹鎵嬫寚婊戝姩 allowTouchMove: TouchMove, navigation: { nextEl: ".about_company_btn_next", prevEl: ".about_company_btn_prev", }, }); }, ProPageSwiper: function () { var that = this; var TouchMove = false; if (that.Width < 1200) { TouchMove = false; } that.ProPageTab = new Swiper(".pro_page_swiper", { initialSlide: 0, effect: "fade", speed: 800, autoHeight: true, //绂佹婊戝姩鏃秙wiper绉诲姩 followFinger: false, //绂佹鎵嬫寚婊戝姩 allowTouchMove: TouchMove, }); }, ContactSwiper: function () { var that = this; var TouchMove = false; if (that.Width < 1200) { TouchMove = false; } that.ContactTab = new Swiper(".contact_page_swiper", { effect: "fade", speed: 800, //绂佹婊戝姩鏃秙wiper绉诲姩 followFinger: false, //绂佹鎵嬫寚婊戝姩 allowTouchMove: TouchMove, }); }, HeaderDownSwiper: function () { var that = this; var TouchMove = false; if (that.Width < 1200) { TouchMove = false; } that.HeaderDownTab = new Swiper(".header_down_nav_swiper", { effect: "fade", speed: 800, //绂佹婊戝姩鏃秙wiper绉诲姩 followFinger: false, //绂佹鎵嬫寚婊戝姩 allowTouchMove: TouchMove, }); }, //瀵艰埅js HeaderMenu: function () { var that = this; $(document).ready(function () { $('.header_wap_menu').menu(); //鍏充簬鎴戜滑 椤电爜 $('.about_item_link').click(function (e) { e.preventDefault(); if ($(this).attr('href') == 'javascript:;') { that.AboutPageTab.slideTo($(this).attr('data-id')); $('.header_wrap').removeClass('header_wap_active'); that.WapNavIF = true; console.log('杩涘叆绗? + $(this).attr('data-id')); } }); $('.header_down_about_link').click(function (e) { e.preventDefault(); if ($(this).attr('href') == 'javascript:;') { var index ; //that.AboutPageTab.slideTo($(this).attr('data-id')); if($(this).attr('flag')==1){ index = 5+$(this).parent().index() }else { index = $(this).parent().index() } that.AboutPageTab.slideTo(index); $('.header_wrap').removeClass('header_wap_active'); } }); //浜у搧涓績 椤电爜 $('.pro_item_link').click(function (e) { e.preventDefault(); if ($(this).attr('href') == 'javascript:;') { that.ProPageTab.slideTo($(this).attr('data-id')); $('.pro_banner_item_box').eq($(this).attr('data-id')).addClass('pro_banner_item_active').siblings().removeClass('pro_banner_item_active'); $(document.body).animate({ scrollTop: $('.pro_page_wrap').offset().top - $('.header_wrap').height() - ($('.pro_banner_list').height()) }, 700); $('html').animate({ scrollTop: $('.pro_page_wrap').offset().top - $('.header_wrap').height() - ($('.pro_banner_list').height()) }, 700); $('.header_wrap').removeClass('header_wap_active'); that.WapNavIF = true; console.log('杩涘叆绗? + $(this).attr('data-id')); } }); }); }, //搴曢儴 footAnimate: function () { var that = this; if (that.Width > 1200) { $(function () { var FootWrap = $('.inner_page_wrap'); var FootContent = $('.inner_page_animate'); // console.log(FootContent.height()); FootWrap.css({ height: parseInt(FootContent.height()) + 'px' }); var scrollTop = $(window).scrollTop(); if (FootContent.length > 0) { var footerHeight = FootWrap.offset().top - scrollTop - that.Height; if (footerHeight <= 0) { FootContent.css({ WebkitTransform: 'translateY(' + parseInt(Math.abs(footerHeight / 2.5)) + 'px)', transform: 'translateY(' + parseInt(Math.abs(footerHeight / 2.5)) + 'px)', }); var ToOpacity = 1 / (FootContent.height() / 2.5); $('.footer_content_box').css({ opacity: parseInt(Math.abs(footerHeight / 2.5)) * ToOpacity }); } } $(window).scroll(function () { var scrollTop = $(window).scrollTop(); if (FootContent.length > 0) { var footerHeight = FootWrap.offset().top - scrollTop - that.Height; if (footerHeight <= 0) { FootContent.css({ WebkitTransform: 'translate3d(0,' + parseInt(Math.abs(footerHeight / 2.5)) + 'px,0)', transform: 'translate3d(0,' + parseInt(Math.abs(footerHeight / 2.5)) + 'px,0)' }); var ToOpacity = 1 / FootContent.height(); $('.footer_content_box').css({ opacity: parseInt(Math.abs(footerHeight)) * ToOpacity }); } } }); }) } }, //瀵艰埅楂樹寒 navHover: function () { $('.public_nav_item').hover(function () { $('.public_nav_item').addClass('public_nav_default'); $('.public_nav_item').eq($(this).index()).addClass('public_nav_hover'); }, function () { $('.public_nav_item').removeClass('public_nav_default public_nav_hover'); }); }, //婊氬姩鏉 Scrollbar: function () { setInterval(function () { $('body').getNiceScroll().resize(); }, 300); var that = this; if (that.Width > 1200) { $(document).ready(function () { $("body").niceScroll({ zindex: "99999", //婊氬姩鏉¢鑹 cursorcolor: "rgba(255,255,255,0)", // 褰撴粴鍔ㄦ潯鏄殣钘忕姸鎬佹椂鏀瑰彉閫忔槑搴︼紝鍊艰寖鍥?鍒? cursoropacitymin: 0, // 褰撴粴鍔ㄦ潯鏄樉绀虹姸鎬佹椂鏀瑰彉閫忔槑搴︼紝鍊艰寖鍥?鍒? cursoropacitymax: 1, //浣垮厜鏍囨嫋鍔ㄦ粴鍔ㄥ儚鍦ㄥ彴寮忕數鑴戣Е鎽歌澶 true婊氬姩鏉℃嫋鍔ㄤ笉鍙敤 touchbehavior: false, // 闅愯棌婊氬姩鏉$殑鏂瑰紡锛屽彲鐢ㄧ殑鍊硷細true|鏃犳粴鍔ㄦ椂闅愯棌锛?cursor"|闅愯棌锛宖alse|涓嶉殣钘忥紝"leave"|浠呭湪鎸囬拡绂诲紑鍐呭鏃堕殣钘忥紝"hidden"|涓€鐩撮殣钘忥紝"scroll"|浠呭湪婊氬姩鏃舵樉绀 autohidemode: true, //鍚敤婊氬姩璺宠穬鐨勫唴瀹圭Щ鍔 bouncescroll: true, //鍙互浣跨敤 CSS 鍙樺瀷鏉ユ粴鍔ㄥ唴瀹 enabletranslate3d: true, // niceScroll 鍙互绠$悊姘村钩婊氬姩 horizrailenabled: false, //鑳屾櫙婊氬姩妲介鑹 background: "rgba(211,211,211,0)", //婊氬姩鏉″搴 cursorwidth: "3px", //婊氬姩鏉′袱澶寸殑鍦嗚 cursorborderradius: "0", //婊氬姩鏉$殑浣嶇疆 railpadding: { top: 0, right: 0, left: 0, bottom: 0 }, //鍙互绠$悊榧犳爣婊氳疆浜嬩欢 enablemousewheel: true, //鍙互绠$悊閿洏浜嬩欢 enablekeyboard: true, //婊氬姩閫熷害 scrollspeed: 60, smoothscroll: 'ease', hidecursordelay: 400, // 榧犳爣婊氬姩鐨勬粴鍔ㄩ€熷害锛堝儚绱狅級 mousescrollstep: 9 * 2, //浠 boxzoom=true 鍜岃Е灞忚澶囨椂鏈夋晥锛夋縺娲诲彉鐒﹀綋 out/in 锛堜袱涓墜鎸囧璐︽垨鏀剁缉锛 gesturezoom: false, //浣犲彲浠ョ敤榧犳爣婊氬姩鍙粴鍔ㄥ尯鍩熺殑婊氬姩鏉″拰澧炲姞榧犳爣婊氳疆浜嬩欢 preservenativescrolling: true, //褰撴寜涓嬬┖鏍兼椂浣块〉闈㈠悜涓嬫粴鍔 spacebarenabled: true, //闃叉澶氳Е鐐规椂闂村紩鍙戞粴鍔 preventmultitouchscrolling: true, }); }); that.NavScroll(); } else { $('body').addClass('body_show'); that.NavScroll(); } }, //鑾峰彇TOP NavScroll: function () { var that = this; that.scrollTop = document.documentElement.scrollTop || document.body.scrollTop; that.NavScrollTop(); // console.log("婊氬姩璺濈" + that.scrollTop); window.onscroll = function () { that.scrollTop = document.documentElement.scrollTop || document.body.scrollTop; that.NavScrollTop(); // console.log("婊氬姩璺濈" + that.scrollTop); }; }, //鍒ゆ柇top鍊 NavScrollTop: function () { var that = this; that.scrollTop = $(window).scrollTop(); that.scrollTop = document.documentElement.scrollTop || document.body.scrollTop; //绉诲姩绔椤靛鑸 if (that.scrollTop > 20) { $('.header_wrap').addClass('header_active'); } else { $('.header_wrap').removeClass('header_active'); } if ($('.pro_banner_fixed').length > 0) { var ProTop = $('.header_wrap').height() + $('.pro_banner_list').height(); if (that.scrollTop + ProTop > $('.pro_page_wrap').offset().top) { console.log('鍒颁簡'); $('.pro_banner_list').addClass('pro_banner_animate'); } else { $('.pro_banner_list').removeClass('pro_banner_animate'); } } that.FadeInUp(); that.SolutionBanner(); that.SolutionHead(); that.SolutionContent(); that.ProBanner(); that.ProItem(); that.ProDetailsBanner(); // that.ProDetailsTips(); that.ProDataBjq(); that.ProRelatedHead(); that.ProRelatedItem(); that.NewBanner(); that.NewContent(); that.ContactWap(); that.SolutionList(); }, //杩涘満 FadeInUp: function () { var that = this; var Item = $('.FadeInUp'); if (Item.length > 0) { for (var i = 0; i < Item.length; i++) { var Height = that.Height * 0.95; var Stop = that.scrollTop + Height; if (Stop > Item.eq(i).offset().top) { Item.eq(i).addClass('AddFadeInUp'); } } } }, SolutionBanner: function () { var that = this; var Item = $('.solution_page_banner_content'); if (Item.length > 0) { for (var i = 0; i < Item.length; i++) { var Height = that.Height * 0.95; var Stop = that.scrollTop + Height; if (Stop > Item.eq(i).offset().top) { Item.eq(i).addClass('SolutionBannerShow'); } } } }, SolutionHead: function () { var that = this; var Item = $('.solution_page_head'); if (Item.length > 0) { for (var i = 0; i < Item.length; i++) { var Height = that.Height * 0.95; var Stop = that.scrollTop + Height; if (Stop > Item.eq(i).offset().top) { Item.eq(i).addClass('SolutionHeadShow'); } } } }, SolutionContent: function () { var that = this; var Item = $('.solution_page_bjq p,.solution_page_bjq h1,.solution_page_bjq h2,.solution_page_bjq h3,.solution_page_bjq h4,.solution_page_bjq table'); if (Item.length > 0) { for (var i = 0; i < Item.length; i++) { var Height = that.Height * 0.95; var Stop = that.scrollTop + Height; if (Stop > Item.eq(i).offset().top) { Item.eq(i).addClass('SolutionContentShow'); } } } }, ProBanner: function () { var that = this; var Item = $('.pro_banner_wrap'); if (Item.length > 0) { for (var i = 0; i < Item.length; i++) { var Height = that.Height * 0.95; var Stop = that.scrollTop + Height; if (Stop > Item.eq(i).offset().top) { Item.eq(i).addClass('ProBannerShow'); } } } }, ProItem: function () { var that = this; var Item = $('.pro_page_item_box'); if (Item.length > 0) { for (var i = 0; i < Item.length; i++) { var Height = that.Height * 0.95; var Stop = that.scrollTop + Height; if (Stop > Item.eq(i).offset().top) { Item.eq(i).addClass('ProItemShow'); } } } }, ProDetailsBanner: function () { var that = this; var Item = $('.pro_details_content'); if (Item.length > 0) { for (var i = 0; i < Item.length; i++) { var Height = that.Height * 0.95; var Stop = that.scrollTop + Height; if (Stop > Item.eq(i).offset().top) { Item.eq(i).addClass('ProDetailsBannerShow'); } } } }, ProDetailsTips: function () { var that = this; var Item = $('.pro_details_tips_box'); if (Item.length > 0) { for (var i = 0; i < Item.length; i++) { var Height = that.Height * 0.95; var Stop = that.scrollTop + Height; if (Stop > Item.eq(i).offset().top) { Item.eq(i).addClass('ProDetailsTipsShow'); } } } }, ProDataBjq: function () { var that = this; var Item = $('.pro_data_bjq p,.pro_data_bjq h1,.pro_data_bjq h2,.pro_data_bjq h3,.pro_data_bjq h4,.pro_data_bjq table'); if (Item.length > 0) { for (var i = 0; i < Item.length; i++) { var Height = that.Height * 0.95; var Stop = that.scrollTop + Height; if (Stop > Item.eq(i).offset().top) { Item.eq(i).addClass('ProDataShow'); } } } }, ProRelatedHead: function () { var that = this; var Item = $('.pro_related_head'); if (Item.length > 0) { for (var i = 0; i < Item.length; i++) { var Height = that.Height * 0.95; var Stop = that.scrollTop + Height; if (Stop > Item.eq(i).offset().top) { Item.eq(i).addClass('ProRelatedHeadShow'); } } } }, ProRelatedItem: function () { var that = this; var Item = $('.pro_related_item_box'); if (Item.length > 0) { for (var i = 0; i < Item.length; i++) { var Height = that.Height * 0.95; var Stop = that.scrollTop + Height; if (Stop > Item.eq(i).offset().top) { Item.eq(i).addClass('ProRelatedItemShow'); } } } }, NewBanner: function () { var that = this; var Item = $('.news_page_banner_content'); if (Item.length > 0) { for (var i = 0; i < Item.length; i++) { var Height = that.Height * 0.95; var Stop = that.scrollTop + Height; if (Stop > Item.eq(i).offset().top) { Item.eq(i).addClass('NewBannerShow'); } } } }, NewContent: function () { var that = this; var Item = $('.news_details_bjq p,.news_details_bjq h1,.news_details_bjq h2,.news_details_bjq h3,.news_details_bjq h4,.news_details_bjq table'); if (Item.length > 0) { for (var i = 0; i < Item.length; i++) { var Height = that.Height * 0.95; var Stop = that.scrollTop + Height; if (Stop > Item.eq(i).offset().top) { Item.eq(i).addClass('NewContentShow'); } } } }, ContactWap: function () { var that = this; var Item = $('.contact_page_content'); if (Item.length > 0) { for (var i = 0; i < Item.length; i++) { var Height = that.Height * 0.95; var Stop = that.scrollTop + Height; if (Stop > Item.eq(i).offset().top) { Item.eq(i).addClass('ContactWapShow'); } } } }, SolutionList: function () { var that = this; var Item = $('.solution_list_content'); if (Item.length > 0) { for (var i = 0; i < Item.length; i++) { var Height = that.Height * 0.95; var Stop = that.scrollTop + Height; if (Stop > Item.eq(i).offset().top) { Item.eq(i).addClass('SolutionList'); } } } }, //杩斿洖椤堕儴 ReturnTop: function () { var that = this; var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; $(document.body).animate({ scrollTop: 0 }, 700); $('html').animate({ scrollTop: 0 }, 700) }, //绉诲姩绔鑸 WapNav: function () { var that = this; var top = 0;//缁檛op鍙橀噺涓€涓垵濮嬪€硷紝浠ヤ究涓嬫柟璧嬪€煎苟寮曠敤銆 $('.header_wap_btn').on('click', function (e) { e.preventDefault(); if (that.WapNavIF) { $('.header_wrap').addClass('header_wap_active'); that.WapNavIF = false; // top = $(window).scrollTop(); // $('body').css("top", -top + "px"); // $('body').addClass('body_flex'); } else { $('.header_wrap').removeClass('header_wap_active'); that.WapNavIF = true; // $('body').removeClass('body_flex'); // $(window).scrollTop(top); } }); }, AboutNumber: function () { var that = this; if (that.NumberIf) { var numberL = $('.index_honor_number'); for (var i = 0; i < numberL.length; i++) { numberL.eq(i).html(that.Number[i]); } console.log(that.Number); $('.index_honor_number').each(function () { $(this).prop('counter', 0).animate({ counter: $(this).text() }, { duration: 1500, easing: 'swing', step: function (now) { now = Math.ceil(now); now = now.toString(); now = now.replace(/\B(?=(\d{3})+(?!\d))/g, ''); $(this).text(now); } }); }); that.NumberIf = false; } }, //閿氱偣鐗规晥 maoAnimate: function () { var that = this; var _hash = window.location.hash; that.maoNumber = $('.header_after').height(); //閿氱偣婊戝姩 $('.anchor_link').click(function () { var $target = $(this.hash); $target = $target.length && $target || $('[name=' + this.hash.slice(1) + ']'); if ($target.length) { var targetOffset = $target.offset().top; $('html,body').animate({ scrollTop: targetOffset - that.maoNumber }, 700); return false; } }); setTimeout(function () { if (_hash && $(_hash).get(0)) { $('html,body').animate({ scrollTop: $(_hash).offset().top - that.maoNumber }, 700); } }, 500); }, //parallax IndexParallax: function () { $('.ParallaxScene').parallax(); }, //Loading Loading: function () { var that = this; var LoadItem = $('.loading_img'); for (var i = 0; i < LoadItem.length; i++) { if (LoadItem.eq(i).attr('src') == "") { console.log('灏戝浘'); } else { that.ImgArray.push( LoadItem.eq(i).attr('src') ); } } //鍘婚噸Img if (that.ImgArray.length > 0) { function unique2(array) { array.sort(); var re = [array[0]]; for (var i = 1; i < array.length; i++) { if (array[i] !== re[re.length - 1]) { re.push(array[i]); } } return re; } that.allImages = unique2(that.ImgArray); } console.log(that.allImages); // that.SvgTimeOver = setInterval(function () { // that.SvgTime += 10; // if (that.SvgTime >= 2200 && that.ImagesLoad) { // clearInterval(that.SvgTimeOver); // that.SvgTime = 0; // // } // }, 10); //鍒濆鍖 if ($('.loading_wrap').length > 0 && that.allImages.length > 0) { function handleComplete() { console.log('鍔犺浇鎴愬姛'); $('.loading_wrap').addClass('loading_animate'); setTimeout(function () { $('.loading_wrap').remove(); that.Init(); }, 1100) } var queue = new createjs.LoadQueue(); queue.installPlugin(createjs.Sound); queue.loadManifest(that.allImages); queue.on("fileload", function (e) { // $('.loading_schedule_box').stop().show(); }); //鐩戝惉杩涘害浜嬩欢 queue.on("progress", function (e) { var proNum = Math.ceil(e.progress * 100); $('.loading_number').html(proNum); $('.loading_logo_box').css({ width: proNum + "%" }) $('.loading_line_after').css({ width: proNum + "%" }) if (proNum >= 100) { that.ImagesLoad = true; } }); queue.on("complete", handleComplete, this); } else { // $('.loading_wrap').remove(); that.Init(); } }, //榛樿鏂规硶 HtmlInit: function () { var that = this; $('body').addClass('body_animate'); $('.header_wrap').addClass('header_show'); that.AddEventList(); that.footAnimate(); //add that.Scrollbar(); that.WapNav(); that.maoAnimate(); that.IndexPageSwiper(); that.IndexBannerSwiper(); that.IndexProSwiper(); that.IndexNewsSwiper(); that.AboutPageSwiper(); that.AboutCompanySwiper(); that.ProPageSwiper(); that.ContactSwiper(); that.HeaderDownSwiper(); that.HeaderMenu(); }, }; $(function () { IqwXiongJs.Loading(); // IqwXiongJs.Init(); });