// 【修复】防御性定义:防止旧版缓存或外部脚本调用未定义函数导致 ReferenceError window.showLodging = window.showLodging || function() {}; window.showLoading = window.showLoading || function() {}; // 【修复】GSAP 兼容:旧版可能通过 k.gsap 调用 GSAP,若 GSAP 未加载则提供空兜底 if (typeof window.gsap === 'undefined' && typeof jQuery !== 'undefined' && jQuery.gsap) { window.gsap = jQuery.gsap; } if (typeof window.gsap === 'undefined') { // 提供最小 gsap 兼容接口,防止 k.gsap is not a function window.gsap = { to: function() {}, from: function() {}, set: function(){}, timeline: function(){ return {to:function(){},from:function(){},set:function(){}}; } }; } $(function() { // 首页增强动效:模块按视口进入、首屏视差与滚动进度条 document.body.classList.add('index-fx-ready'); var fxTargets = document.querySelectorAll('.index-news-box, .about-stat-wrap, .about-stat-videos, .our-services-box, .our-job-box, .our-client-box, .our-partner-box'); for (var fxIndex = 0; fxIndex < fxTargets.length; fxIndex++) { fxTargets[fxIndex].classList.add('index-fx-target'); } if ('IntersectionObserver' in window) { var fxObserver = new IntersectionObserver(function(entries) { entries.forEach(function(entry) { if (entry.isIntersecting) { entry.target.classList.add('index-fx-visible'); fxObserver.unobserve(entry.target); } }); }, { threshold: 0.12, rootMargin: '0px 0px -8% 0px' }); for (var fxObserveIndex = 0; fxObserveIndex < fxTargets.length; fxObserveIndex++) { fxObserver.observe(fxTargets[fxObserveIndex]); } } else { for (var fxFallbackIndex = 0; fxFallbackIndex < fxTargets.length; fxFallbackIndex++) { fxTargets[fxFallbackIndex].classList.add('index-fx-visible'); } } var scrollProgress = document.querySelector('.index-scroll-progress span'); var updateScrollProgress = function() { if (!scrollProgress) return; var scrollable = document.documentElement.scrollHeight - window.innerHeight; scrollProgress.style.width = (scrollable > 0 ? (window.scrollY / scrollable) * 100 : 0) + '%'; }; window.addEventListener('scroll', updateScrollProgress, { passive: true }); updateScrollProgress(); var heroTech = document.querySelector('.index-hero-tech'); var heroBox = document.querySelector('.lunbo-box'); if (heroTech && heroBox && window.matchMedia('(pointer:fine)').matches) { heroBox.addEventListener('pointermove', function(event) { var rect = heroBox.getBoundingClientRect(); var x = (event.clientX - rect.left) / rect.width - .5; var y = (event.clientY - rect.top) / rect.height - .5; heroTech.style.transform = 'translate3d(' + (x * 12) + 'px,' + (y * 8) + 'px,0)'; }); heroBox.addEventListener('pointerleave', function() { heroTech.style.transform = ''; }); } $('.service-card').on('pointermove', function(event) { var rect = this.getBoundingClientRect(); this.style.setProperty('--card-x', ((event.clientX - rect.left) / rect.width * 100) + '%'); this.style.setProperty('--card-y', ((event.clientY - rect.top) / rect.height * 100) + '%'); }); // 小屏菜单按钮 function menu() { if ($(window).width() < 769) { $("body").on("click", ".menu_btn", function(event) { event.stopPropagation() $(".head_right_menu").slideToggle(); }) $("body:not(.menu_btn)").click(function() { $(".head_right_menu").slideUp(); }) /* */ // $(".team-swiper-container .swiper-slide").css("width", "60%") } } menu(); // menu下拉逻辑 $(".menu_detail_box .menu_detail_item").hide(); $(".head_right_menu a").click(function(event){ $(".menu_detail_box").hide(); var elementOffset = $(this).offset(); var viewportLeft = elementOffset.left - $(window).scrollLeft(); // 获取相对于视口的左边距 var viewportWidth = $(window).width(); // 获取视口的宽度 var leftPercentage = (viewportLeft / viewportWidth) * 100; // 计算百分比 console.log(leftPercentage,"leftPercentage") var detailIndex = $(this).data('menu-detail'); if(typeof detailIndex !== 'undefined'){ $(".menu_detail_box").css("width","auto") $(".menu_detail_box .menu_detail_item .menu_left_box").css("background","rgb(243 243 243 / 80%)") $(".menu_detail_box").css("left",(leftPercentage-3)+'%') $(".head_right_menu a").removeClass("selected") $(this).addClass("selected") $(".menu_detail_box .menu_detail_item").hide(); $(".menu_detail_box .menu_detail_item").eq(detailIndex).show() $(".menu_detail_box").slideDown(500) } }) // 业务领域三级菜单悬停交互 $(document).on('mouseenter', '.menu-business-area .ba-level-1 > li', function() { var target = $(this).data('ba-target'); $('.menu-business-area .ba-level-1 > li').removeClass('ba-active'); $(this).addClass('ba-active'); $('.menu-business-area .ba-level-2').removeClass('ba-active'); $('.menu-business-area .ba-level-3').removeClass('ba-active'); if (target) { $('.menu-business-area .ba-level-2[data-ba-parent="' + target + '"]').addClass('ba-active'); } }); $(document).on('mouseenter', '.menu-business-area .ba-level-2 > li', function() { var target = $(this).data('ba-target'); $('.menu-business-area .ba-level-2 > li').removeClass('ba-active'); $(this).addClass('ba-active'); $('.menu-business-area .ba-level-3').removeClass('ba-active'); if (target) { $('.menu-business-area .ba-level-3[data-ba-parent="' + target + '"]').addClass('ba-active'); } }); $(document).on('click', function(event) { if (!$(event.target).closest('.menu_detail_box').length && $(event.target).closest('.head_right_menu').length == 0) { $(".menu_detail_box").slideUp("fast") $(".menu_detail_box .menu_detail_item").hide(); } }); var swiper = new Swiper('.video-swiper-container', { grabCursor: true, effect: "creative", creativeEffect: { prev: { shadow: true, translate: ["-125%", 0, -800], rotate: [0, 0, -90], }, next: { shadow: true, translate: ["125%", 0, -800], rotate: [0, 0, 90], }, }, autoplay: { delay: 2500, disableOnInteraction: false, }, pagination: { el: ".video-swiper-pagination", type: "fraction", }, }); $('.btn1').on('click', function () { $('#item').popup({ time: 1000, classAnimateShow: 'flipInX', classAnimateHide: 'hinge', onPopupClose: function e() { console.log('0') var video = document.getElementById("video-box1"); video.pause(); // 暂停视频 video.currentTime = 0; }, onPopupInit: function e() { console.log('1') } }); }); $('.btn2').on('click', function () { $('#item1').popup({ time: 1000, classAnimateShow: 'flipInX', classAnimateHide: 'hinge', onPopupClose: function e() { console.log('0') var video = document.getElementById("video-box2"); video.pause(); // 暂停视频 video.currentTime = 0; }, onPopupInit: function e() { console.log('1') } }); }); $('.btn3').on('click', function () { $('#item2').popup({ time: 1000, classAnimateShow: 'flipInX', classAnimateHide: 'hinge', onPopupClose: function e() { console.log('0') var video = document.getElementById("video-box3"); video.pause(); // 暂停视频 video.currentTime = 0; }, onPopupInit: function e() { console.log('1') } }); }); // 公司简介 $('#company-overview-service1').hover(function() { // 鼠标移入时的操作 $("content-box.company-overview-2025 .company-overview-service-box .service-item").animate({ width: "30%" }, 1000); $(this).animate({ width: "40%" }, 500); }, function() { // 鼠标移出时的操作 $(this).animate({ width: "32%" }, 500); }); $('#company-overview-service2').hover(function() { // 鼠标移入时的操作 $("content-box.company-overview-2025 .company-overview-service-box .service-item").animate({ width: "30%" }, 1000); $(this).animate({ width: "40%" }, 500); }, function() { // 鼠标移出时的操作 $(this).animate({ width: "32%" }, 500); }); $('#company-overview-service3').hover(function() { // 鼠标移入时的操作 $("content-box.company-overview-2025 .company-overview-service-box .service-item").animate({ width: "30%" }, 1000); $(this).animate({ width: "40%" }, 500); }, function() { // 鼠标移出时的操作 $(this).animate({ width: "32%" }, 500); }); // 监听宣传片 // 获取目标元素 const targetElement = document.getElementById('index-video-name'); if (targetElement) { // 创建一个Intersection Observer实例 const observer = new IntersectionObserver(entries => { entries.forEach(entry => { if (entry.isIntersecting) { $("#about-company").animate({ left: "13%" // 或者具体像素值,例如 "100px" }, 1500); } }); }); // 观察目标元素 observer.observe(targetElement); } // 监听我们的服务 // 获取目标元素 const targetElement2 = document.getElementById('index-service-name'); if(targetElement2){ // 创建一个Intersection Observer实例 const observer2 = new IntersectionObserver(entries => { entries.forEach(entry => { if (entry.isIntersecting) { $("#our-service-box").animate({ left: "10%" // 或者具体像素值,例如 "100px" }, 1500); } }); }); // 观察目标元素 observer2.observe(targetElement2); } // 监听职业发展 // 获取目标元素 const targetElement3 = document.getElementById('index-job-name'); if(targetElement3){ // 创建一个Intersection Observer实例 const observer3 = new IntersectionObserver(entries => { entries.forEach(entry => { if (entry.isIntersecting) { $("#our-job-box").animate({ left: "50%" // 或者具体像素值,例如 "100px" }, 1500); } }); }); // 观察目标元素 observer3.observe(targetElement3); } // 监听职业发展 // 获取目标元素 const targetElement4 = document.getElementById('job-img-target'); if(targetElement4){ // 创建一个Intersection Observer实例 const observer4 = new IntersectionObserver(entries => { entries.forEach(entry => { if (entry.isIntersecting) { $("#job-fly-box").animate({ bottom: "0" // 或者具体像素值,例如 "100px" }, 2000); } }); }); // 观察目标元素 observer4.observe(targetElement4); } // 监听企业文化-logo // 获取目标元素 const targetElement5 = document.getElementById('culture-box'); if(targetElement5){ // 创建一个Intersection Observer实例 const observer5 = new IntersectionObserver(entries => { entries.forEach(entry => { if (entry.isIntersecting) { $(".company-culture-box .culture-box img").animate({ left: "80px" // 或者具体像素值,例如 "100px" }, 2500); } }); }); // 观察目标元素 observer5.observe(targetElement5); } // 监听企业文化-内容 // 获取目标元素 const targetElement6 = document.getElementById('culture-box'); if(targetElement6){ // 创建一个Intersection Observer实例 const observer6 = new IntersectionObserver(entries => { entries.forEach(entry => { if (entry.isIntersecting) { $(".company-culture-box .culture-box .text-box").animate({ right: "-40px" // 或者具体像素值,例如 "100px" }, 2500); } }); }); // 观察目标元素 observer6.observe(targetElement6); } // 监听首页新闻与活动 - 行业资讯列表 // 获取目标元素 const targetElement7 = document.getElementById('news-activity-target'); if(targetElement7){ // 创建一个Intersection Observer实例 const observer7 = new IntersectionObserver(entries => { entries.forEach(entry => { if (entry.isIntersecting) { $(".news-activity-box .news-item:last-child .lunbo-news-item").animate({},1500,function(){ $(this).css({'transform':'translateX(0px)'}); }) $(".news-activity-box .news-item:first-child").animate({},1500,function(){ $(this).css({'transform':'translateX(0px)'}); }) $(".news-activity-box .news-item:nth-child(2)").animate({},2500,function(){ $(this).css({'transform':'translateX(0px)'}); }) } }); }); // 观察目标元素 observer7.observe(targetElement7); } // 监听篮球之队研究院 - 专家介绍 // 获取目标元素 const targetElement8 = document.getElementById('introduce-box'); if(targetElement8){ // 创建一个Intersection Observer实例 const observer8 = new IntersectionObserver(entries => { entries.forEach(entry => { if (entry.isIntersecting) { $(".expert-box .introduce-box img").animate({},2000,function(){ $(this).css({'transform':'translateX(0px)'}); }) $(".expert-box .introduce-box .text").animate({},2000,function(){ $(this).css({'transform':'translateX(0px)'}); }) } }); }); // 观察目标元素 observer8.observe(targetElement8); } // 监听职业发展 - 联系我们 // 获取目标元素 const targetElement9 = document.getElementById('about-us-box'); if(targetElement9){ // 创建一个Intersection Observer实例 const observer9 = new IntersectionObserver(entries => { entries.forEach(entry => { if (entry.isIntersecting) { $(".about-us-box .abous-us-list .about-us-list-item:nth-child(1)").animate({},2000,function(){ $(this).css({'transform':'translateX(0px)'}); }) $(".about-us-box .abous-us-list .about-us-list-item:nth-child(3)").animate({},3000,function(){ $(this).css({'transform':'translateX(0px)'}); }) $(".about-us-box .abous-us-list .about-us-list-item:nth-child(5)").animate({},4000,function(){ $(this).css({'transform':'translateX(0px)'}); }) $(".about-us-box .abous-us-list .about-us-list-item:nth-child(7)").animate({},5000,function(){ $(this).css({'transform':'translateX(0px)'}); }) $(".about-us-box .abous-us-list .about-us-list-item:nth-child(9)").animate({},6000,function(){ $(this).css({'transform':'translateX(0px)'}); }) $(".about-us-box .abous-us-list .about-us-list-item:nth-child(2)").animate({},2000,function(){ $(this).css({'transform':'translateX(0px)'}); }) $(".about-us-box .abous-us-list .about-us-list-item:nth-child(4)").animate({},4000,function(){ $(this).css({'transform':'translateX(0px)'}); }) $(".about-us-box .abous-us-list .about-us-list-item:nth-child(6)").animate({},6000,function(){ $(this).css({'transform':'translateX(0px)'}); }) $(".about-us-box .abous-us-list .about-us-list-item:nth-child(8)").animate({},8000,function(){ $(this).css({'transform':'translateX(0px)'}); }) } }); }); // 观察目标元素 observer9.observe(targetElement9); } // 监听职业发展 - 联系我们 // 获取目标元素 const targetElement10 = document.getElementById('honor-top-box'); if(targetElement10){ // 创建一个Intersection Observer实例 const observer10 = new IntersectionObserver(entries => { entries.forEach(entry => { if (entry.isIntersecting) { $(".honor-top-box .detail").animate({},2000,function(){ $(this).css({'transform':'translateX(40px)'}); }) $(".honor-top-box .img-box").animate({},2000,function(){ $(this).css({'transform':'translateX(-100px)'}); }) } }); }); // 观察目标元素 observer10.observe(targetElement10); } // 监听关于篮球之队文本 - 滚动到该位置时从左往右划入到当前位置 const aboutStatText = document.getElementById('about-stat-text'); if (aboutStatText) { if (!('IntersectionObserver' in window)) { aboutStatText.classList.add('is-in'); } else { const observerAbout = new IntersectionObserver(entries => { entries.forEach(entry => { if (entry.isIntersecting) { aboutStatText.classList.add('is-in'); observerAbout.unobserve(aboutStatText); } }); }, { threshold: 0.2 }); observerAbout.observe(aboutStatText); } } // 监听数据统计 - 滚动到该位置时数字从0滚动到目标值(与视频效果一致) const aboutStatData = document.getElementById('about-stat-data'); if (aboutStatData) { // 轻量数字滚动计数器:ease-out + 千分位格式 function runCountUp(el, targetNum) { var duration = 2000; // 动画时长 2s(与视频一致) var startTime = null; function step(timestamp) { if (!startTime) startTime = timestamp; var progress = Math.min((timestamp - startTime) / duration, 1); // ease-out cubic 缓动,数字先快后慢 var eased = 1 - Math.pow(1 - progress, 3); var current = Math.round(eased * targetNum); el.textContent = current.toLocaleString('zh-CN'); if (progress < 1) { requestAnimationFrame(step); } } requestAnimationFrame(step); } if (!('IntersectionObserver' in window)) { // 不支持 IO 的浏览器直接显示最终值 var vals = aboutStatData.querySelectorAll('.stat-value'); for (var j = 0; j < vals.length; j++) { vals[j].textContent = parseInt(vals[j].dataset.target).toLocaleString('zh-CN'); } } else { var observerStatData = new IntersectionObserver(function(entries) { entries.forEach(function(entry) { if (entry.isIntersecting) { var values = aboutStatData.querySelectorAll('.stat-value'); for (var i = 0; i < values.length; i++) { var target = parseInt(values[i].dataset.target); if (!isNaN(target)) runCountUp(values[i], target); } observerStatData.unobserve(aboutStatData); // 只播一次 } }); }, { threshold: 0.25 }); observerStatData.observe(aboutStatData); } } $.goup({ trigger: 100, bottomOffset: 50, locationOffset: 50, title: '', titleAsText: true }); // 首页-我们的服务轮播 var opt = { "speed" : "normal" , //变换速度,三速度可选 slow,normal,fast; "by" : "mouseover" , //触发事件,click或者mouseover; "auto" : true , //是否自动播放; "sec" : 3000 //自动播放间隔; }; $("#demo").IMGDEMO(opt); // 公司简介 产品展示 $(".company-overview-service-box .box ul li").hover(function(){ $(this).addClass("on").siblings().removeClass("on"); }) // 新闻中心 hover事件 $(".news-list .news_right").hover(function(){ $(this).find(".news-list-left .date-day").css("color","#fff") $(this).find(".news-list-left .date-other").css("color","#fff") $(this).find(".news-list-middle .news-title").css("color","#fff") $(this).find(".news-list-middle .news-content").css("color","#fff") },function(){ $(this).find(".news-list-left .date-day").css("color","#000") $(this).find(".news-list-left .date-other").css("color","#666") $(this).find(".news-list-middle .news-title").css("color","#333") $(this).find(".news-list-middle .news-content").css("color","#666") }) $(".news-tab-box:not(.service-tab-box) .tab-box ul li").click(function(){ $(".news-tab-box .tab-box ul li").removeClass("active") $(this).addClass("active") }) // $(window).resize(function () { // location.reload(); // menu(); // }) // 招聘岗位 $(".Recruitmenttitle").on("click", function() { // console.log(111); // alert(1111) $(this).next().slideToggle(); // alert($(this).next()) $(this).parent("li").toggleClass("cur"); $(this).parent("li").siblings().removeClass("cur"); $(this).parent("li").siblings().find(".RecruitmentContent").slideUp(); }) /*产品移动端匹配*/ // var widths = $("#service-box").find(".content_products_type").find("img").width(); // var heights = $("#service-box").find(".content_products_type").find("img").height(); // // console.log(widths); // // console.log(heights); // var widths1 = $("#service-box").find(".content_products_type").find("a").width(); // var heights1 = $("#service-box").find(".content_products_type").find("a").height(); // $("#service-box").find(".content_products_type").find(".masks").css("width", widths); // $("#service-box").find(".content_products_type").find(".masks").css("height", heights); // $("#education_service").find(".content_products_type").find("img").css("width", widths); // $("#education_service").find(".content_products_type").find("img").css("height", heights); // $("#education_service").find(".content_products_type").find(".masks").css("width", widths); // $("#education_service").find(".content_products_type").find(".masks").css("height", heights); // $("#education_service").find(".content_products_type").css("marginTop", "10px") // $("#education_service").find(".content_products_type").find("a").css("width", widths1) // $("#education_service").find(".content_products_type").find("a").css("height", heights1) $(".team_master_more").click(function() { $(this).prev().toggleClass("team_active"); $(this).parent().siblings().find(".team_master_title3").removeClass("team_active"); $(this).find("span").toggleClass("team_active_btn"); $(this).parent().siblings().find("span").removeClass("team_active_btn"); $(this).parent().siblings().find("b").text("展开"); $(".team-swiper-container").css("height", "auto"); if ($(".team_active_btn").length == '1') { $(this).find("b").text("收起"); } else { $(this).find("b").text("展开"); } $(".team_master").css("height", "auto"); }) /*首页轮播图 */ var swipers = new Swiper(".mySwiper", { autoplay: { delay: 3000, stopOnLastSlide: false, disableOnInteraction: true, }, loop: true, pagination: { el: ".swiper-pagination", }, }); var swipers = new Swiper(".clientSwiper", { slidesPerView: 6, slidesPerGroup: 6, spaceBetween: 20, loop: true, grabCursor: true, autoplay: { delay: 3000, disableOnInteraction: false, stopOnLastSlide: false, }, }); var swiperss = new Swiper(".partnersSwiper", { slidesPerView: 6, slidesPerGroup: 6, spaceBetween: 20, loop: true, grabCursor: true, autoplay: { delay: 3000, disableOnInteraction: false, stopOnLastSlide: false, }, }); var swiperss = new Swiper(".valueCreateSwiper", { slidesPerView: 4, spaceBetween: 10, // autoplay: { // delay: 3000, // stopOnLastSlide: false, // disableOnInteraction: true, // }, loop: true, navigation: { nextEl: ".swiper-button-next-valueCreate", prevEl: ".swiper-button-prev-valueCreate", }, }); var swiperss = new Swiper(".RiskComplianceSwiper", { slidesPerView: 4, spaceBetween: 10, // autoplay: { // delay: 3000, // stopOnLastSlide: false, // disableOnInteraction: true, // }, loop: true, navigation: { nextEl: ".swiper-button-next-RiskCompliance", prevEl: ".swiper-button-prev-RiskCompliance", }, }); var swiperss = new Swiper(".InnovativeServicesSwiper", { slidesPerView: 4, spaceBetween: 10, // autoplay: { // delay: 3000, // stopOnLastSlide: false, // disableOnInteraction: true, // }, loop: true, navigation: { nextEl: ".swiper-button-next-InnovativeServices", prevEl: ".swiper-button-prev-InnovativeServices", }, }); var swiperss = new Swiper(".DailyConsultationSwiper", { slidesPerView: 4, spaceBetween: 10, // autoplay: { // delay: 3000, // stopOnLastSlide: false, // disableOnInteraction: true, // }, loop: true, navigation: { nextEl: ".swiper-button-next-DailyConsultation", prevEl: ".swiper-button-prev-DailyConsultation", }, }); var swiperss = new Swiper(".InternationalSwiper", { slidesPerView: 4, spaceBetween: 10, // autoplay: { // delay: 3000, // stopOnLastSlide: false, // disableOnInteraction: true, // }, loop: true, navigation: { nextEl: ".swiper-button-next-International", prevEl: ".swiper-button-prev-International", }, }); // var player = polyvPlayer({ // 'wrap':'#plv_375e54969e54d469def8e0cece8a5d84_3', // 'width':'auto', // 'height':'600', // 'vid': '375e54969e54d469def8e0cece8a5d84_3', // loading_bg_img: $("#video1-poster").val(), // cover_display:'scaleAspectFit', // cover_opacity:10, // 'playsafe': '' // }); // $(".high-end-treebox .level2").hide(); // $(".daily-treebox .level2").eq(1).show(); $(".treebox .level1>a").click(function(){ console.log($(this).hasClass('current'),"123321") if(!$(this).hasClass('current')){ $(".treebox .level1>a").removeClass("current"); $(this).addClass('current') //给当前元素添加"current"样式 .find('i').addClass('down') //小箭头向下样式 .parent().next().slideDown('slow','easeOutQuad') //下一个元素显示 .parent().siblings().children('a').removeClass('current')//父元素的兄弟元素的子元素去除"current"样式 .find('i').removeClass('down').parent().next().slideUp('slow','easeOutQuad');//隐藏 // $(".high-end-treebox .level2").hide(); // $(this).parent().find(".level2").show() $(".news-breadcrumbs span").text($(this).text()); }else{ $(".treebox .level1>a").removeClass("current"); $(this).removeClass('current') //给当前元素添加"current"样式 .find('i').removeClass('down') //小箭头向下样式 .parent().next().slideUp('slow','easeOutQuad') //下一个元素显示 .parent().siblings().children('a').removeClass('current')//父元素的兄弟元素的子元素去除"current"样式 .find('i').removeClass('down').parent().next().slideUp('slow','easeOutQuad');//隐藏 // $(".high-end-treebox .level2").hide(); // $(this).parent().find(".level2").show() $(".news-breadcrumbs span").text($(this).text()); } }); // 首页服务客户和战略伙伴动态效果 function onScroll() { // 获取所有具有 "animate-element" 类的 DOM 元素 var doms = document.getElementsByClassName("animate-element"); if (!doms) { return; } // 遍历这些 DOM 元素 for (var i = 0; i < doms.length; i++) { var dom = doms[i]; // 如果元素已经有 "animated" 类,则跳过该元素 if (dom.className.indexOf("animated") > -1) { continue; } // 获取元素的位置信息 var domRect = dom.getBoundingClientRect(); // 计算元素顶部距离窗口顶部的高度 var domVisibleHeight = window.innerHeight - domRect.top; // 如果元素距离窗口顶部的高度大于 100 像素,开始动画 if (domVisibleHeight > 150) { // 获取元素数据集中的动画类型,默认为 "fly-up" var animation = dom.dataset.animation || "fly-up"; // 获取元素数据集中的动画延迟时间 var animationDelay = dom.dataset.animationDelay; // 添加 "animated" 类以标识元素已经被动画 dom.className = dom.className + " animated"; dom.className = dom.className + " fly-up"; if (!animationDelay) { // 如果没有动画延迟,立即添加动画类 dom.className = dom.className + " " + animation; } else { // 如果有动画延迟,使用 setTimeout 在指定延迟后添加动画类 (function (_dom) { setTimeout(function () { _dom.className = _dom.className + " " + animation; }, animationDelay); })(dom); } } } } window.addEventListener("scroll", onScroll, false); // 我们的服务tab切换逻辑 // 职业发展首页 福利待遇 hover逻辑 $(".welfare-box .welfare-list .welfare-item").hover(function(){ $(this).addClass("hover"); $(this).find(".img").hide() $(this).find(".img-hover").show() $(this).find(".welfare-title").css("color","#fff") $(this).find(".welfare-detail").css("color","#fff") },function(){ $(this).removeClass("hover") $(this).find(".img").show() $(this).find(".img-hover").hide() $(this).find(".welfare-title").css("color","#333") $(this).find(".welfare-detail").css("color","#666") }) // 倒计时 function getRTime() { var EndTime = new Date("2021/06/24 00:00"); //截止时间 var NowTime = new Date(); var t = EndTime.getTime() - NowTime.getTime(); var d = Math.floor(t / 1000 / 60 / 60 / 24); var h = Math.floor(t / 1000 / 60 / 60 % 24); var m = Math.floor(t / 1000 / 60 % 60); document.getElementById("t_d").innerHTML = d; document.getElementById("t_h").innerHTML = h; document.getElementById("t_m").innerHTML = m; } // setInterval(getRTime, 1000); $(".job-box .menu li.level1>a").click(function(){ $(".tyintroduce-menu .level1").eq(1).find("a").addClass("current"); }) //首页切换 $(".service-items-tab li").click(function(){ var index = $(this).index(); $(".service-items-tab li").removeClass("active"); $(this).addClass("active"); $(".service-items-box .service-item-list").hide() $(".service-items-box .service-item-list").eq(index).show() }) $(".service-items-tab li").eq(0).click(); $(".news-box-2024 .news-list .tab-box ul li").click(function(){ $(".news-box-2024 .news-list .tab-box ul li").removeClass("active") $(this).addClass("active") var index = $(this).index() $(".news-box-2024 .news-list .tab-box .more-btn").hide(); $(".news-box-2024 .news-list .tab-box .more-btn").eq(index).show() $(".news-box-2024 .news-list .news-content .news-content-item").hide(); $(".news-box-2024 .news-list .news-content .news-content-item").eq(index).show() }) $(".news-box-2024 .news-list .tab-box ul li").eq(0).click() $('.menu_detail_box .menu_detail_item .menu_right_box ul li').hover(function() { // 鼠标移入时的操作 $(this).find("img").show() }, function() { // 鼠标移出时的操作 $(this).find("img").hide() }); }) jQuery(document).ready(function($) { // 篮球之队研究院 - 专家介绍 点击专家卡片切换详情 以及返回专家卡片列表的逻辑 $(".expert-box .expert-list .expert-item img.link-icon").click(function(){ let index = $(this).parent().attr("attr-index") console.log(index,"indexxxxxxxxx") $(".expert-box .expert-detail .expert-detail-item").each(function(i,v){ let detailIndex = $(this).attr("attr-index") if(index == detailIndex){ $(".expert-box .expert-list").hide() $(".expert-box .expert-detail .expert-detail-item").hide() $(".expert-box .expert-detail .expert-btn-box").show() $(this).show(); } }) }) $(".expert-box .expert-detail .expert-btn-box").click(function(){ $(".expert-box .expert-list").show() $(".expert-box .expert-detail .expert-btn-box").hide() $(".expert-box .expert-detail .expert-detail-item").hide() }) $('.culture-list .culture-list-item .culture-text-add1').on('click', function () { $('#culture').popup({ time: 1000, classAnimateShow: 'flipInX', classAnimateHide: 'hinge', onPopupClose: function e() { console.log('0') }, onPopupInit: function e() { console.log('1') } }); }); $('.culture-list .culture-list-item .culture-text-add2').on('click', function () { $('#culture2').popup({ time: 1000, classAnimateShow: 'flipInX', classAnimateHide: 'hinge', onPopupClose: function e() { console.log('0') }, onPopupInit: function e() { console.log('1') } }); }); $('.culture-list .culture-list-item .culture-text-add3').on('click', function () { $('#culture3').popup({ time: 1000, classAnimateShow: 'flipInX', classAnimateHide: 'hinge', onPopupClose: function e() { console.log('0') }, onPopupInit: function e() { console.log('1') } }); }); $('.culture-list .culture-list-item .culture-text-add4').on('click', function () { $('#culture4').popup({ time: 1000, classAnimateShow: 'flipInX', classAnimateHide: 'hinge', onPopupClose: function e() { console.log('0') }, onPopupInit: function e() { console.log('1') } }); }); $('#def-html').darkTooltip({ opacity:1, gravity:'west' }); var pathname = window.location.pathname; if(pathname.indexOf("en") > 0){ // 联系我们 地区切换逻辑 $(".contact-box .address-box ul.en li").click(function(){ let index = $(this).index() $(".contact-box .address-box ul.en li").removeClass("active") $(this).addClass("active") $(".contact-box .address-box .detail.en img").hide() $(".contact-box .address-box .detail.en img").eq(index).show() $(".contact-box .address-box .detail.en .address-msg").hide() $(".contact-box .address-box .detail.en .address-msg").eq(index).show() }) $(".contact-box .address-box ul.en li").eq(0).click() }else{ // 联系我们 地区切换逻辑 $(".contact-box .address-box ul.zh li").click(function(){ let index = $(this).index() $(".contact-box .address-box ul.zh li").removeClass("active") $(this).addClass("active") $(".contact-box .address-box .detail.zh img").hide() $(".contact-box .address-box .detail.zh img").eq(index).show() $(".contact-box .address-box .detail.zh .address-msg").hide() $(".contact-box .address-box .detail.zh .address-msg").eq(index).show() }) $(".contact-box .address-box ul.zh li").eq(0).click() } // 公司荣誉轮播图 var swiper = new Swiper('.honor-box .swiper-container', { autoplay: { delay: 3000, stopOnLastSlide: false, disableOnInteraction: false, }, loop: true, // effect: 'fade', scrollbar: { el: ".swiper-scrollbar", type: "progressbar", }, pagination: { el: ".swiper-pagination", clickable: true, }, }); // 大事记时间轴 if ($.fn.Timeline && $('.timeline-3').length) { $('.timeline-3').Timeline({ mode: 'vertical', dotsPosition: 'right', itemClass: 'box-item' }); } // 职业发展岗位列表点击到岗位详情的逻辑 $(".zp-post-box .post-table-box .post-table tr td a").click(function(){ let postAttr = $(this).attr("post_attr") let areaAttr = $(this).attr("area_attr") sessionStorage.setItem('postAttr', postAttr) sessionStorage.setItem('areaAttr', areaAttr) }) setTimeout(function() { var getPostAttr = sessionStorage.getItem('postAttr') var getAreaAttr = sessionStorage.getItem('areaAttr') $(".post-detail-box .post-detail-item").hide() $(".post-detail-box .post-detail-item").each(function(i,v) { if($(this).attr("post_detail_attr") == getPostAttr){ $(this).show() } }); $(".area-detail-box .area-detail-item").each(function(j,m) { if($(this).attr("area_detail_attr") == getAreaAttr){ $(this).show() } }); }, 1000); });