/* * JS基础处理框架 */ var IqwXiongJs = { Width: $(window).width(), Height: $(window).height(), //锚点距离 maoNumber: 100, //数字滚动判断 NumberIf: true, socialNumberIf: true, FootNumberIf: true, Number: [], //有锚点才吸顶 maoTop: false, bannerAnimation: 'AddFadeInUp', //滚动条 MyScroll: null, //增加 WapNavIF: true, BannerSwiper: null, NewsMaxSwiper: null, NewsMaxSwiper2: null, WapSwiper: null, AboutDevelopmentTipsTab: null, AboutDevelopmentContentTab: null, AboutHonorTab0: null, AboutHonorTab1: null, AboutHonorTab2: null, AboutHonorTab3: null, AboutHonorTab4: null, AboutHonorTab5: null, AboutHonorTab6: null, AboutHonorTab7: null, AboutHonorNavTab: null, BusinessTypeTab: null, BusinessContentTab: null, BusinessCaseTab: null, PartyNewsTab: [], NewsSpaceBetween: 0, //EventKey: "ontouchstart" in document.documentElement ? "touchstart" : "click", Init: function () { var that = this; that.HtmlInit(); }, numberRoll: function () { var that = this; if ($('.index_number').length > 0) { //窗口滚动 var dataTop = $('.index_number').offset().top; var dataH = dataTop - that.Height; var scrollTop = $(window).scrollTop(); if (scrollTop > dataH && scrollTop < dataTop) { // that.NumberCount(); that.indexNumber(); } $(window).scroll(function () { var dataTop = $('.index_number').offset().top; var dataH = dataTop - that.Height; var scrollTop = $(window).scrollTop(); if (scrollTop > dataH && scrollTop < dataTop) { // that.NumberCount(); that.indexNumber(); } }); } }, socialNumberRoll: function () { var that = this; if ($('.social_number').length > 0) { //窗口滚动 var dataTop = $('.social_number').offset().top; var dataH = dataTop - that.Height; var scrollTop = $(window).scrollTop(); if (scrollTop > dataH && scrollTop < dataTop) { // that.NumberCount(); that.socialNumber(); } $(window).scroll(function () { var dataTop = $('.social_number').offset().top; var dataH = dataTop - that.Height; var scrollTop = $(window).scrollTop(); if (scrollTop > dataH && scrollTop < dataTop) { // that.NumberCount(); that.socialNumber(); } }); } }, ImgRoll: function () { var that = this; if ($('.index_business_back').length > 0 && that.Width > 1200) { $(window).scroll(function () { var dataTop = $('.index_business_back').offset().top; var dataH = dataTop - that.Height; var scrollTop = $(window).scrollTop(); if (scrollTop > dataH) { // that.NumberCount(); console.log((scrollTop - dataH) / 7); $('.index_business_back img').css({ top: -((scrollTop - dataH) / 7) + "px" }) } }); } }, FootNumberRoll: function () { var that = this; if ($('.foot_number').length > 0) { //窗口滚动 var dataTop = $('.foot_number').offset().top; var dataH = dataTop - that.Height; var scrollTop = $(window).scrollTop(); if (scrollTop > dataH && scrollTop < dataTop) { that.FooterNumber(); } $(window).scroll(function () { var dataTop = $('.foot_number').offset().top; var dataH = dataTop - that.Height; var scrollTop = $(window).scrollTop(); if (scrollTop > dataH && scrollTop < dataTop) { that.FooterNumber(); } }); } }, FooterNumber: function () { var that = this; if (that.FootNumberIf) { var numberL = $('.foot_number'); for (var i = 0; i < numberL.length; i++) { numberL.eq(i).html(that.Number[i]); } $('.foot_number').each(function () { $(this).prop('counter', 0).animate({ counter: $(this).text() }, { duration: 2000, easing: 'swing', step: function (now) { now = Math.ceil(now); now = now.toString(); now = now.replace(/\B(?=(\d{3})+(?!\d))/g, ''); $(this).text(now); } }); }); that.FootNumberIf = false; } }, indexNumber: function () { var that = this; if (that.NumberIf) { var numberL = $('.index_number'); for (var i = 0; i < numberL.length; i++) { numberL.eq(i).html(that.Number[i]); } console.log(that.Number); $('.index_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; } }, PartyNumber: function () { var that = this; if (that.NumberIf) { var numberL = $('.party_number'); for (var i = 0; i < numberL.length; i++) { numberL.eq(i).html(that.Number[i]); } console.log(that.Number); $('.party_number').each(function () { $(this).prop('counter', 0).animate({ counter: $(this).text() }, { duration: 2500, 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; } }, socialNumber: function () { var that = this; if (that.socialNumberIf) { var numberL = $('.social_number'); for (var i = 0; i < numberL.length; i++) { numberL.eq(i).html(that.Number[i]); } console.log(that.Number); $('.social_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.socialNumberIf = false; } }, //banner BannerTab: function () { var that = this; that.BannerSwiper = new Swiper('.banner_box', { loop: true, effect: 'fade', pagination: { el: '.banner_pagination', clickable: true, }, speed: 1000, autoplay: { delay: 8000, stopOnLastSlide: false, disableOnInteraction: false, }, navigation: { nextEl: '.banner_next', prevEl: '.banner_prev', }, loopedSlides: document.querySelectorAll('.swiper-slide').length, on: { init: function () { $('.banner_wrap').addClass('banner_current'); }, } }); }, //新闻栏目切换 NewsTab: function () { var that = this; that.NewsMaxSwiper = new Swiper('.index_news_swiper', { speed: 600, loop: true, navigation: { nextEl: '.index_news_next', prevEl: '.index_news_prev', }, }); }, //新闻栏目切换 NewsTab2: function () { var that = this; that.NewsMaxSwiper2 = new Swiper('.maxNews', { speed: 600, loop: true, on: { init: function () { $('.index_news_label_item').on('click', function (e) { e.preventDefault(); $('.index_news_label_item').eq($(this).index()).addClass('index_news_label_active').siblings().removeClass('index_news_label_active'); that.NewsMaxSwiper2.slideTo($(this).index() + 1); }) } } }); }, AboutDevelopmentTipsSwiper: function () { var that = this; var TouchMove = false; var aSlidesPerView = 8; if (that.Width < 1200) { TouchMove = true; aSlidesPerView = 4; } that.AboutDevelopmentTipsTab = new Swiper('.about_development_tips_tab', { speed: 600, slidesPerView: aSlidesPerView, allowTouchMove: TouchMove, navigation: { nextEl: ".about_development_tips_next", prevEl: ".about_development_tips_prev", }, on: { init: function () { $('.about_development_tips_tab .swiper-slide').eq(1).find('.about_development_tips_item').addClass('about_development_tips_current'); } } }); }, AboutDevelopmentContentSwiper: function () { var that = this; var TouchMove = false; if (that.Width < 1200) { TouchMove = true; } that.AboutDevelopmentContentTab = new Swiper('.about_development_content_swiper', { speed: 600, effect: 'fade', allowTouchMove: TouchMove, }); }, AboutHonorNavSwiper: function () { var that = this; var TouchMove = false; if (that.Width < 1200) { TouchMove = true; } that.AboutHonorNavTab = new Swiper('.about_honor_nav_swiper', { speed: 600, effect: 'fade', allowTouchMove: TouchMove, }); $('.about_honor_item_box').on('click', function (e) { e.preventDefault(); $('.about_honor_item_box').eq($(this).index()).addClass('about_honor_item_current').siblings().removeClass('about_honor_item_current'); $('.about_honor_content_box').eq($(this).index()).addClass('about_honor_content_current').siblings().removeClass('about_honor_content_current'); }); }, AboutHonorSwiper0: function (e) { var that = this; var TouchMove = false; var aSpaceBetween = that.Width * 0.0208333; var aSlidesPerView = 4; if (that.Width < 1200) { TouchMove = true; aSlidesPerView = 1.5; } that.AboutHonorTab0 = new Swiper('.about_honor_content_tab0', { speed: 600, loop: true, slidesPerView: aSlidesPerView, spaceBetween: aSpaceBetween, allowTouchMove: TouchMove, navigation: { nextEl: ".about_honor_pagination0 .honor_pagination_next", prevEl: ".about_honor_pagination0 .honor_pagination_prev", }, }); }, AboutHonorSwiper1: function (e) { var that = this; var TouchMove = false; var aSpaceBetween = that.Width * 0.0208333; var aSlidesPerView = 4; if (that.Width < 1200) { TouchMove = true; aSlidesPerView = 1.5; } that.AboutHonorTab1 = new Swiper('.about_honor_content_tab1', { speed: 600, loop: true, slidesPerView: aSlidesPerView, spaceBetween: aSpaceBetween, allowTouchMove: TouchMove, navigation: { nextEl: ".about_honor_pagination1 .honor_pagination_next", prevEl: ".about_honor_pagination1 .honor_pagination_prev", }, }); }, AboutHonorSwiper2: function (e) { var that = this; var TouchMove = false; var aSpaceBetween = that.Width * 0.0208333; var aSlidesPerView = 4; if (that.Width < 1200) { TouchMove = true; aSlidesPerView = 1.5; } that.AboutHonorTab2 = new Swiper('.about_honor_content_tab2', { speed: 600, loop: true, slidesPerView: aSlidesPerView, spaceBetween: aSpaceBetween, allowTouchMove: TouchMove, navigation: { nextEl: ".about_honor_pagination2 .honor_pagination_next", prevEl: ".about_honor_pagination2 .honor_pagination_prev", }, }); }, AboutHonorSwiper3: function (e) { var that = this; var TouchMove = false; var aSpaceBetween = that.Width * 0.0208333; var aSlidesPerView = 4; if (that.Width < 1200) { TouchMove = true; aSlidesPerView = 1.5; } that.AboutHonorTab3 = new Swiper('.about_honor_content_tab3', { speed: 600, loop: true, slidesPerView: aSlidesPerView, spaceBetween: aSpaceBetween, allowTouchMove: TouchMove, navigation: { nextEl: ".about_honor_pagination3 .honor_pagination_next", prevEl: ".about_honor_pagination3 .honor_pagination_prev", }, }); }, AboutHonorSwiper4: function (e) { var that = this; var TouchMove = false; var aSpaceBetween = that.Width * 0.0208333; var aSlidesPerView = 4; if (that.Width < 1200) { TouchMove = true; aSlidesPerView = 1.5; } that.AboutHonorTab4 = new Swiper('.about_honor_content_tab4', { speed: 600, loop: true, slidesPerView: aSlidesPerView, spaceBetween: aSpaceBetween, allowTouchMove: TouchMove, navigation: { nextEl: ".about_honor_pagination4 .honor_pagination_next", prevEl: ".about_honor_pagination4 .honor_pagination_prev", }, }); }, AboutHonorSwiper5: function (e) { var that = this; var TouchMove = false; var aSpaceBetween = that.Width * 0.0208333; var aSlidesPerView = 4; if (that.Width < 1200) { TouchMove = true; aSlidesPerView = 1.5; } that.AboutHonorTab5 = new Swiper('.about_honor_content_tab5', { speed: 600, loop: true, slidesPerView: aSlidesPerView, spaceBetween: aSpaceBetween, allowTouchMove: TouchMove, navigation: { nextEl: ".about_honor_pagination5 .honor_pagination_next", prevEl: ".about_honor_pagination5 .honor_pagination_prev", }, }); }, AboutHonorSwiper6: function (e) { var that = this; var TouchMove = false; var aSpaceBetween = that.Width * 0.0208333; var aSlidesPerView = 4; if (that.Width < 1200) { TouchMove = true; aSlidesPerView = 1.5; } that.AboutHonorTab6 = new Swiper('.about_honor_content_tab6', { speed: 600, loop: true, slidesPerView: aSlidesPerView, spaceBetween: aSpaceBetween, allowTouchMove: TouchMove, navigation: { nextEl: ".about_honor_pagination6 .honor_pagination_next", prevEl: ".about_honor_pagination6 .honor_pagination_prev", }, }); }, AboutHonorSwiper7: function (e) { var that = this; var TouchMove = false; var aSpaceBetween = that.Width * 0.0208333; var aSlidesPerView = 4; if (that.Width < 1200) { TouchMove = true; aSlidesPerView = 1.5; } that.AboutHonorTab7 = new Swiper('.about_honor_content_tab7', { speed: 600, loop: true, slidesPerView: aSlidesPerView, spaceBetween: aSpaceBetween, allowTouchMove: TouchMove, navigation: { nextEl: ".about_honor_pagination7 .honor_pagination_next", prevEl: ".about_honor_pagination7 .honor_pagination_prev", }, }); }, BusinessTypeSwiper: function () { var that = this; var TouchMove = false; var aSpaceBetween = that.Width * 0.001041666; var aSlidesPerView = 4; if (that.Width > 1200 && $('.business_type_swiper').hasClass('business_type_max')) { aSlidesPerView = 2; } else if (that.Width < 1200 && $('.business_type_swiper').hasClass('business_type_max')) { aSlidesPerView = 1.5; } if (that.Width < 1200) { TouchMove = true; aSlidesPerView = 1.5; } that.BusinessTypeTab = new Swiper('.business_type_swiper', { speed: 600, slidesPerView: aSlidesPerView, spaceBetween: aSpaceBetween, allowTouchMove: TouchMove, navigation: { nextEl: ".business_type_pagination_next", prevEl: ".business_type_pagination_prev", }, }); }, BusinessContentSwiper: function () { var that = this; var TouchMove = false; if (that.Width < 1200) { TouchMove = true; } that.BusinessContentTab = new Swiper('.business_content_swiper', { speed: 600, effect: 'fade', allowTouchMove: TouchMove, }); }, BusinessCaseSwiper: function () { var that = this; var TouchMove = false; var aSpaceBetween = that.Width * 0.036458333; var aSlidesPerView = 3; if (that.Width < 1200) { TouchMove = true; aSlidesPerView = 1.5; } that.BusinessCaseTab = new Swiper('.business_case_swiper', { speed: 600, loop: true, slidesPerView: aSlidesPerView, spaceBetween: aSpaceBetween, allowTouchMove: TouchMove, navigation: { nextEl: ".business_case_next", prevEl: ".business_case_prev", }, }); }, PartyNewsSwiper: function () { var that = this; var TouchMove = false; var aSpaceBetween = that.Width * 0.0208333; var aSlidesPerView = 3; var $partyNewsSwiper=$('.party_news_swiper'); if($partyNewsSwiper.length==0){ return false; } if (that.Width < 1200) { TouchMove = true; aSlidesPerView = 1.5; } $partyNewsSwiper.each(function(_index,el){ var $el=$(el); var _id=$el.attr('data-id'); var newTab = new Swiper('.party_news_swiper_gxt'+_id, { speed: 600+_index*100, loop: true, slidesPerView: aSlidesPerView, spaceBetween: aSpaceBetween, allowTouchMove: TouchMove, navigation: { nextEl: ".party_news_pagination_next_gxt"+_id, prevEl: ".party_news_pagination_prev_gxt"+_id, }, }); that.PartyNewsTab.push(newTab); }); }, //地图 WapTab: function () { var that = this; var TouchMove = false; if (that.Width < 1200) { TouchMove = true; } that.WapSwiper = new Swiper('.index_wap_tab', { speed: 600, //禁止手指滑动 allowTouchMove: TouchMove, on: { init: function () { $('.index_wap_icon_item').hover(function () { $('.index_wap_icon_item').eq($(this).index()).addClass('index_wap_icon_active').siblings().removeClass('index_wap_icon_active'); that.WapSwiper.slideTo($(this).index()); }); } } }); }, //导航高亮 navHover: function () { $('.header_nav_item').hover(function () { $('.header_nav_item').addClass('header_nav_default'); $('.header_nav_item').eq($(this).index()).addClass('header_nav_hover'); }, function () { $('.header_nav_item').removeClass('header_nav_default header_nav_hover'); }); }, //滚动条 Scrollbar: function () { var that = this; setInterval(function () { $('body').getNiceScroll().resize(); }, 300); if (that.Width > 1200) { $(document).ready(function () { $("body").niceScroll({ zindex: "99999", //滚动条颜色 cursorcolor: "#333", //滚动条的透明度,从0-1 cursoropacitymax: .5, //使光标拖动滚动像在台式电脑触摸设备 true滚动条拖动不可用 touchbehavior: false, autohidemode: false, //背景滚动槽颜色 background: "", //滚动条宽度 cursorwidth: "5px", //滚动条两头的圆角 cursorborderradius: "3px", //滚动条的位置 railpadding: { top: 0, right: 2, left: 0, bottom: 0 }, //可以管理鼠标滚轮事件 enablemousewheel: true, //可以管理键盘事件 enablekeyboard: true, //滚动速度 scrollspeed: 150, smoothscroll: true, hidecursordelay: 600, // 鼠标滚动的滚动速度(像素) mousescrollstep: 9 * 4, //仅 boxzoom=true 和触屏设备时有效)激活变焦当 out/in (两个手指外账或收缩) gesturezoom: false, //你可以用鼠标滚动可滚动区域的滚动条和增加鼠标滚轮事件 preservenativescrolling: true, //当按下空格时使页面向下滚动 spacebarenabled: true, //防止多触点时间引发滚动 preventmultitouchscrolling: true, }); }); that.NavScroll(); } else { 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 > 50) { $('.header_wrap').addClass('header_active'); } else { $('.header_wrap').removeClass('header_active'); } if (that.Width > 1200) { if (that.scrollTop > ($('.public_banner_wrap').height()) && $('.public_banner_wrap').length > 0) { $('.about_nav_box').addClass('fixed_top'); $('.header_wrap ').addClass('fixed_up'); } else { $('.about_nav_box').removeClass('fixed_top'); $('.header_wrap ').removeClass('fixed_up'); } } that.FadeInUp(); that.LineW(); that.FadeInLeft(); that.FadeInRight(); that.WapIn(); that.currentThis(); that.PartyBox(); that.JoinBox(); that.PartyNumberItem(); that.NewsItem(); }, //地图进场 WapIn: function () { var that = this; var WapBox = $('.index_wap_back'); if (WapBox.length > 0) { var Height = that.Height * .5; var Stop = that.scrollTop + Height; if (Stop > WapBox.offset().top) { console.log('进场'); for (var i = 0; i < $('.index_wap_icon_max').length; i++) { $('.index_wap_icon_max').eq(i).addClass('index_wap_top'); } for (var j = 0; j < $('.index_wap_icon_min').length; j++) { $('.index_wap_icon_min').eq(j).css({ animationDelay: ((j + 3) * 100) + 'ms', WebkitAnimationDelay: ((j + 3) * 100) + 'ms', }); $('.index_wap_icon_min').eq(j).addClass('index_wap_scale'); } for (var v = 0; v < $('.index_wap_icon_small').length; v++) { $('.index_wap_icon_small').eq(v).css({ animationDelay: ((v + 7) * 100) + 'ms', WebkitAnimationDelay: ((v + 7) * 100) + 'ms', }); $('.index_wap_icon_small').eq(v).addClass('index_wap_scale'); } } } }, //进场 FadeInUp: function () { var that = this; var fadeInUp = $('.fadeInUp'); for (var i = 0; i < fadeInUp.length; i++) { var Height = that.Height * 0.9; var Stop = that.scrollTop + Height; if (Stop > fadeInUp.eq(i).offset().top) { fadeInUp.eq(i).addClass('AddFadeInUp'); } } }, //进场左边 FadeInLeft: function () { var that = this; var fadeInLeft = $('.fadeInLeft'); for (var i = 0; i < fadeInLeft.length; i++) { var Height = that.Height * 0.9; var Stop = that.scrollTop + Height; if (Stop > fadeInLeft.eq(i).offset().top) { fadeInLeft.eq(i).addClass('AddFadeInLeft'); } } }, //进场右边 FadeInRight: function () { var that = this; var fadeInRight = $('.fadeInRight'); for (var i = 0; i < fadeInRight.length; i++) { var Height = that.Height * 0.9; var Stop = that.scrollTop + Height; if (Stop > fadeInRight.eq(i).offset().top) { fadeInRight.eq(i).addClass('AddFadeInRight'); } } }, //进场 LineW: function () { var that = this; var LineW = $('.lineW'); for (var i = 0; i < LineW.length; i++) { var Height = that.Height * 0.9; var Stop = that.scrollTop + Height; if (Stop > LineW.eq(i).offset().top) { LineW.eq(i).addClass('AddLineW'); } } }, //返回顶部 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;//给top变量一个初始值,以便下方赋值并引用。 $('.header_wap_box').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); } }); }, //事件 AddEventList: function () { var that = this; function return_false() { return false; } $('#top').on('click', function (e) { e.preventDefault(); that.ReturnTop(); }); //搜索 $('.header_search_show').on('click', function (e) { e.preventDefault(); $('.header_search_box').addClass('header_search_active'); }); $('.header_search_hide').on('click', function (e) { e.preventDefault(); $('.header_search_box').removeClass('header_search_active'); }); //底部友情链接 $('.footer_link_item_title').on('click', function (e) { e.preventDefault(); $('.footer_link_item').removeClass('footer_link_active'); $(this).parents('.footer_link_item').addClass('footer_link_active'); }); $('.footer_link_item').hover(function () { }, function () { $('.footer_link_item').removeClass('footer_link_active'); }); $('.about_introduce_btn_box').on('click', function (e) { e.preventDefault(); $('.about_introduce_read').css({ height: $('.about_introduce_bjq').height() }); $('.about_introduce_btn_wrap').addClass('about_introduce_btn_hide'); }); $('.about_development_tips_tab .swiper-slide .about_development_tips_text').on('click', function (e) { e.preventDefault(); console.log($(this).index()); $('.about_development_tips_item').removeClass('about_development_tips_current'); $(this).parents('.about_development_tips_item').addClass('about_development_tips_current'); that.AboutDevelopmentContentTab.slideTo(parseInt($(this).parents('.about_development_tips_item').attr('data-id')) - 1); }); $('.honor_popup_close').on('click', function (e) { e.preventDefault(); $('.honor_popup_wrap').removeClass('honor_popup_show'); }); $('.business_type_link').on('click', function (e) { e.preventDefault(); $('.business_type_link').removeClass('business_type_current'); $(this).addClass('business_type_current'); that.BusinessContentTab.slideTo($(this).attr('data-id')); }); $('.business_case_btn').hover(function () { $('.business_case_btn').eq($(this).index()).addClass('business_case_current').siblings().removeClass('business_case_current'); }); }, //锚点特效 maoAnimate: function () { var that = this; var _hash = window.location.hash; if (that.Width < 1200) { that.maoNumber = 60; } //锚点滑动 $('.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); }, //播放视频 VideoPlay: function () { var that = this; var top = 0;//给top变量一个初始值,以便下方赋值并引用。 $('.about_video_click').on('click', function (e) { e.preventDefault(); top = $(window).scrollTop(); $('body').css("top", -top + "px"); $('body').addClass('body_flex'); $('.about_video_black_wrap').addClass('about_video_active'); $('.about_video_time').trigger('play'); $('.about_content_video_read').trigger('pause'); }); $('.about_video_hide').on('click', function (e) { e.preventDefault(); $('body').removeClass('body_flex'); $(window).scrollTop(top); $('.about_video_black_wrap').removeClass('about_video_active'); $('.about_video_time').trigger('pause'); $('.about_content_video_read').trigger('play'); document.getElementById("about_video_time").currentTime = 0; }); }, //Loading Loading: function () { var that = this; var allImages = []; for (var i = 0; i < $('img').length; i++) { allImages.push( {src: $('img').eq(i).attr('src')} ); } console.log(allImages); if ($('.loading_wrap').length > 0) { function handleComplete() { console.log('加载成功'); //加载完成启动网站 $('.loading_wrap').addClass('loading_active'); $('.loading_logo').addClass('loading_fade'); setTimeout(function () { $('body').removeClass('body_flex'); $('.loading_wrap').remove(); that.Init(); }, 1000); } var queue = new createjs.LoadQueue(); queue.installPlugin(createjs.Sound); queue.loadManifest(allImages); queue.on("fileload", function (e) { $('.loading_schedule_box').stop().show(); }); //监听进度事件 queue.on("progress", function (e) { var proNum = Math.ceil(e.progress * 100); $('.loading_speed_after').css({ width: proNum + "%" }); $('.loading_speed_number').html(proNum); }); queue.on("complete", handleComplete, this); } else { that.Init(); } }, currentThis: function () { var that = this; if(that.Width>1200){ var currentItem = $('.about_page_box'); for (var i = 0; i < currentItem.length; i++) { var Height = that.Height; var Stop = that.scrollTop + Height - (Height * 0.2); if (Stop > currentItem.eq(i).offset().top) { $('.about_nav_item').removeClass('about_nav_active'); $('.about_nav_item').eq(i).addClass('about_nav_active'); } } } }, PartyBox: function () { var that = this; var currentItem = $('.party_build_content'); for (var i = 0; i < currentItem.length; i++) { var Height = that.Height; var Stop = that.scrollTop + Height * 0.7; if (Stop > currentItem.eq(i).offset().top) { currentItem.eq(i).addClass('AddPartyBox'); } } }, JoinBox: function () { var that = this; var currentItem = $('.join_team_content'); for (var i = 0; i < currentItem.length; i++) { var Height = that.Height; var Stop = that.scrollTop + Height * 0.7; if (Stop > currentItem.eq(i).offset().top) { currentItem.eq(i).addClass('AddJoinBox'); } } }, PartyNumberItem: function () { var that = this; var currentItem = $('.party_build_big_item'); for (var i = 0; i < currentItem.length; i++) { var Height = that.Height; var Stop = that.scrollTop + Height * 0.8; if (Stop > currentItem.eq(i).offset().top) { console.log(i); currentItem.eq(i).find('.party_build_big_current').css({ strokeDashoffset: 314.15927 - (314.15927 / 100) * currentItem.eq(i).attr('data-progress') + '%' }) that.PartyNumber(); } } }, NewsItem: function () { var that = this; var currentItem = $('.news_content_box p'); for (var i = 0; i < currentItem.length; i++) { var Height = that.Height; var Stop = that.scrollTop + Height * 0.8; if (Stop > currentItem.eq(i).offset().top) { currentItem.eq(i).addClass('AddNewsItem'); } } }, search:function(){ var $btn=$('#xgl_submit_btn'),$input=$('#xgl_search_input'); if(!$btn.length || !$input.length){return false;} function transform_famat(val){ val=val+''; val=val.replace(/%/g,'%25'); val=val.replace(/&/g,'%26'); val=val.replace(/\//g,'%2F'); val=val.replace(/\\/g,'%5C'); val=val.replace(/\s/g,'%20'); val=val.replace(/\*/g,'%2A'); val=val.replace(//g,'%3E'); val=val.replace(/\?/g,'%3F'); val=val.replace(/#/g,'%23'); return val; } $btn.click(function(){ var search_value=$input.val(),redirect_url=''; if(search_value==""){ alert('请输入关键词!'); return false; } search_value = transform_famat(search_value); redirect_url='/search/keyword/'+search_value; window.location.href=redirect_url; }); $input.on('keydown',function(e){ var keyCode = e.keyCode || e.which || e.charCode; if(keyCode==13){ $btn.click(); } }); }, //默认方法 HtmlInit: function () { var that = this; //add that.search(); that.AddEventList(); that.Scrollbar(); that.maoAnimate(); that.WapNav(); setTimeout(function () { that.BannerTab(); }, 1000); that.navHover(); that.NewsTab(); that.NewsTab2(); that.numberRoll(); that.FootNumberRoll(); that.socialNumberRoll(); that.WapTab(); that.ImgRoll(); that.VideoPlay(); that.AboutDevelopmentTipsSwiper(); that.AboutDevelopmentContentSwiper(); that.AboutHonorSwiper0(); that.AboutHonorSwiper1(); that.AboutHonorSwiper2(); that.AboutHonorSwiper3(); that.AboutHonorSwiper4(); that.AboutHonorSwiper5(); that.AboutHonorSwiper6(); that.AboutHonorSwiper7(); that.AboutHonorNavSwiper(); that.BusinessTypeSwiper(); that.BusinessContentSwiper(); that.BusinessCaseSwiper(); that.PartyNewsSwiper(); $('.honor_content_item_img').on('click', function (e) { e.preventDefault(); $('.honor_popup_wrap').addClass('honor_popup_show'); $('.honor_popup_img img').attr('src', $(this).find('img').attr('src')) }); }, }; $(function () { IqwXiongJs.Loading(); // $('.footer_head_item').eq(1).find('.footer_head_text').html('深圳市福田区深南大道7028号时代科技大厦东座16.18.22.23层'); // IqwXiongJs.Init(); });