/*****************/ function stopBubble(e) { // 如果传入了事件对象,那么就是非ie浏览器 if (e && e.stopPropagation) { //因此它支持W3C的stopPropagation()方法 e.stopPropagation(); } else { //否则我们使用ie的方法来取消事件冒泡 window.event.cancelBubble = true; } } var tap = 'ontouchstart' in document ? 'touchend' : 'click'; var winWt = parseInt($(window).width()), winHt = parseInt($(window).height()); //实现滚动条无法滚动 var winHadntScroll = function(e) { e.preventDefault(); }; /***禁止滑动***/ function scrollStop() { var h = $(window).height(); document.body.style.overflow = 'hidden'; document.addEventListener("touchmove", winHadntScroll, { passive: false }); //禁止页面滑动 } /***取消滑动限制***/ function scrollMove() { document.body.style.overflow = ''; //出现滚动条 document.removeEventListener("touchmove", winHadntScroll, { passive: false }); } /// 锚点跳转 function anchorMove(id, delval, fn) { var $obj = $(id), delval = delval, moveFun = fn; var oh = $obj.offset().top; if (delval) { oh = oh - parseInt(delval); } $('html,body').animate({ scrollTop: oh }, 500, function() { if (moveFun) moveFun(); }); }; /// 竖向滚动条 if ($('.scrollbox').length > 0) { $('.scrollbox').mCustomScrollbar({ scrollbarPosition: 'outside', scrollInertia: 1000, advanced: { updateOnContentResize: true } }); if (winWt < 992) { $('.scrollbox').mCustomScrollbar("destroy"); } } /// 横向滚动条 if ($('.scrollbox2').length > 0) { $('.scrollbox2').mCustomScrollbar({ axis: "x", mouseWheel: true, advanced: { updateOnContentResize: true } }); if (winWt < 992) { $('.scrollbox2').mCustomScrollbar("destroy"); } } // 页面滚动wow.js再ie9以上引用 var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset: 100, mobile: true, live: true }); if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))) { wow.init(); }; // 模态框 $('.modal').on('shown.bs.modal', function() { $('body').addClass('modal-open'); if ($(this).find('video').length) { var videoId = $(this).find('.video-js').attr('id'); var myPlayer = videojs(videoId); myPlayer.play(); } }); $('.modal').on('hidden.bs.modal', function() { if ($(this).find('video').length) { var videoId = $(this).find('.video-js').attr('id'); var myPlayer = videojs(videoId); myPlayer.pause(); myPlayer.currentTime(0); } }); $('.modal-close,.about3op .modal-dialog').on('click', function() { var $modal = $(this).parents('.modal'); $modal.modal('hide'); }); // 判断设备 var os = function() { var ua = navigator.userAgent, isWindowsPhone = /(?:Windows Phone)/.test(ua), isSymbian = /(?:SymbianOS)/.test(ua) || isWindowsPhone, isAndroid = /(?:Android)/.test(ua), isIOS = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), isFireFox = /(?:Firefox)/.test(ua), isChrome = /(?:Chrome|CriOS)/.test(ua), isTablet = /(?:iPad|PlayBook)/.test(ua) || (isAndroid && !/(?:Mobile)/.test(ua)) || (isFireFox && /(?:Tablet)/.test( ua)), isPhone = /(?:iPhone)/.test(ua) && !isTablet, isPc = !isPhone && !isAndroid && !isSymbian; return { isTablet: isTablet, isPhone: isPhone, isAndroid: isAndroid, isIOS: isIOS, isPc: isPc }; }(); // 是否IE function IEVersion() { var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串 var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器 var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器 var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1; if (isIE) { var reIE = new RegExp("MSIE (\\d+\\.\\d+);"); reIE.test(userAgent); var fIEVersion = parseFloat(RegExp["$1"]); if (fIEVersion == 7) { return 7; } else if (fIEVersion == 8) { return 8; } else if (fIEVersion == 9) { return 9; } else if (fIEVersion == 10) { return 10; } else { return 6; //IE版本<=7 } } else if (isEdge) { return 'edge'; //edge } else if (isIE11) { return 11; //IE11 } else { return -1; //不是ie浏览器 } } // 判断是否微信 function is_weixin() { var ua = navigator.userAgent.toLowerCase(); if (ua.match(/MicroMessenger/i) == "micromessenger") { return true; } else { return false; } } if (!os.isPc) { $('body').addClass('is-iphone'); } else { $('body').addClass('is-pc'); } if (os.isAndroid) { $('body').addClass('is-android'); } if (os.isIOS) { $('body').addClass('is-ios'); } if (is_weixin()) { $('body').addClass('is-wx'); } else { $('body').addClass('not-wx'); } if (IEVersion() == 'edge') { $('body').addClass('is-edge'); } else if (IEVersion() > -1) { $('body').addClass('is-' + IEVersion()); } // 单选框 $('.check-list label').on(tap, function() { $(this).parent('li').addClass('is-checked').siblings().removeClass('is-checked'); }); // 视频 $('.btn-open_video').on(tap, function() { $('.modal-video').modal('show'); }); $('[data-toggle="tab"]').on(tap, function() { var id = $(this).attr('href'), $lis = $(this).parent('li'); $(this).tab('show'); $lis.addClass('active').siblings().removeClass('active').find('[data-toggle="tab"]').removeClass('active'); }); /******************************/ // 置顶 $(window).on('scroll', function() { var winWt = parseInt($(window).width()), winHt = parseInt($(window).height()); var wintop = $(window).scrollTop(); if (wintop > winHt / 2) { $('.btn-gotop').css('display', 'block'); } else { $('.btn-gotop').hide(); } }); $('.btn-gotop').on('click', function() { $('html,body').animate({ 'scrollTop': '0' }) }) // 底部技术支持 if ($('.foot-jszc_swip').length) { var footJsSwip = new Swiper('.foot-jszc_swip', { direction: 'vertical', autoplay: { delay: 1000, disableOnInteraction: false, }, loop: true, observer: true, observeParents: true, }); } $('.gg-search').on(tap, function(e) { // $('.search-box').slideToggle(300, 'linear'); // $('.search-box').slideToggle(300, 'linear'); stopBubble(e) $('body').toggleClass("head-white1") $('.ph-nav-box').removeClass('on') $('.ph-nav-box').removeClass('open') $('.head-menu_open').removeClass('on') $('.head-menu_open').removeClass('open') $('body').toggleClass("head-white-s") $('body').removeClass("head-white-c") $('body').removeClass("open") // $('body').addClass('head2block') }) $(window).scroll(function() { // console.log($(window).scrollTop(), '$(window).scrollTop() '); if ($(window).scrollTop() > 200) { $('body').addClass('head2block') $('.p-hrdet').addClass('p-hrdet2') $('body').removeClass('head-top') } else { $('body').removeClass('head2block') $('.p-hrdet').removeClass('p-hrdet2') $('body').addClass('head-top') } }) $('.headwap .rightic').on(tap, function() { $('body').addClass('wapblock') }) $('.wapheadClose').on(tap, function() { $('body').removeClass('wapblock') }) $('.waptab .tit').on('click', function() { $('.waptab .bottom').slideToggle() $('body').toggleClass('jianttou') }) $('.headtabs li').on('mouseenter', function() { // $(this).find('.headbottom').css('display', 'block') $(this).addClass('active1').siblings().removeClass('active1') // $(this).find('.headbottom').fadeIn(50, function() {}) $('.p-home').addClass('head2block') $('.p-hr').addClass('head2block') }) $('.headtabs').on('mouseleave', function() { $('.p-hr').removeClass('head2block') }) $('.headtabs li').on('mouseleave', function() { // $(this).find('.headbottom').css('display', 'none') }) $('.headtabs').on('mouseleave', function() { $('.headtabs li').removeClass('active1') // $('.p-home').removeClass('head2block') }) $('.haschild').on('click', function() { $(this).parent().find('.lv2box').slideToggle() $(this).parent().siblings().find('.lv2box').slideUp() }) // 业务 $('.bus3btn').on('click', function() { $(this).addClass('act').siblings().removeClass('act') $('.bus4 .big-inner').eq($(this).index()).fadeIn().siblings().css('display', 'none') }) if (screen.width < 992) { if ($('.comcenSwiper').length) { var comcenSwiper1 = new Swiper('.comcenSwiper1', { observer: true, observeParents: true, spaceBetween: 20, pagination: { el: ".comcenpag1", }, }); } if ($('.comcenSwiper').length) { var comcenSwiper2 = new Swiper('.comcenSwiper2', { observer: true, observeParents: true, pagination: { el: ".comcenpag2", }, }); } } if ($('.wapmap').length) { var wapmap = new Swiper('.wapmap', { observer: true, observeParents: true, loop: true, pagination: { el: ".comcenpag21", }, on: { transitionEnd: function() { var activeIndex = this.realIndex; $('.wapmap .maptext .item').eq(activeIndex).fadeIn().siblings().hide(); // setTimeout(() => { // $('.maptext .item').eq(this.realIndex).hide() // }, 5000); }, }, }); } var aboutSwip = new Swiper('.aboutSwip', { observer: true, observeParents: true, slidesPerView: 1, spaceBetween: 15, autoplay: { delay: 2000, stopOnLastSlide: false, disableOnInteraction: true, }, pagination: { el: ".about3pag", type: "progressbar", }, speed: 1000, loop: true, breakpoints: { 992: { slidesPerView: 4, slidesPerGroup: 1, spaceBetween: 30, pagination: { el: ".about3pag", clickable: true, }, }, }, }); // $('.hrsearch input').bind('click', function(e) { // stopBubble(e) // }); // if (winWt > 992) { var contactboxLength = $('.contactbox li').length; console.log(contactboxLength); if (contactboxLength <= 2) { $('.contactbox .row').css('justify-content', 'center') } } $('.memcen li').addClass('wow fadeInUp2') $('.memcen ul li').addClass('wow fadeInUp2') $('.memcen li+li+li+li+li').removeClass('wow fadeInUp2') $('.membtn a').on(tap, function() { $('.memcen li+li+li+li+li').css('display', 'block') $(this).css('display', 'none') // $('body,html').scrollTop($('.memcen li').eq(1).offset().top); }) $('.hrsearch_head .box').removeClass('wow fadeInUp2') // $('.hrsearch_head.tabbox').addClass('wow fadeInUp2') $('.p-hrlist .all').attr('data-wow-delay', '.2s') $('.p-hrlist .hrsearch_cen ul').attr('data-wow-delay', '.4s') $('.about1 ul').attr('data-wow-delay', '.2s') $('.aboutvideo').attr('data-wow-delay', '.2s') $('.p-culture .cur1 li').eq(0).addClass('wow fadeInUp2').attr('data-wow-delay', '.2s') $('.p-culture .cur1 li').eq(1).addClass('wow fadeInUp2').attr('data-wow-delay', '.4s') $('.p-culture .cur1 li').eq(2).addClass('wow fadeInUp2').attr('data-wow-delay', '.6s') // $('.searchdetbox').addClass('wow fadeInUp2').attr('data-wow-delay', '.2s')