$(function () { var winW = $(window).width(); $(function () { if ($('.e-module-202403261417').length > 0) { function module202403261417Fun($target) { var module202403261417Obj = { init: function () { // 获取属性 this.win = $(window); this.bannerObj = $target; this.bannerText = this.bannerObj.find('.text'); this.resizeInit(); this.addVideoLink(this.bannerObj.find('>.e-lazy')); this.setTextTime(); this.resizeEvent(); }, resizeInit: function () { this.winw = this.win.width(); }, addVideoLink: function (bgObj) { if (bgObj.data('src') != undefined && bgObj.data('src') != '' && this.winw > 1200) { // 添加video的dom结构 if (bgObj.find('.video').length == 0) { bgObj.append( "" ); } // 判断视频是否已经赋值,如果赋值了,就不需要再次赋值了。 var videoObj = bgObj.find('.video'); if (videoObj.attr("src") != bgObj.data('src')) { videoObj.attr("src", bgObj.data('src')); } } else { bgObj.find('.video').remove(); } }, setTextTime: function () { if (this.winw > 1200) { var videoObj = $(".e-module-202403261417 .video")[0]; // 获取视频对象 var videoCurrentTime = 0; // 获取视频播放到第几秒 var loopStart = 5; // 无限轮播开始时间 var loopEnd = 11; // 无限轮播结束时间 // 开启监听定时器 var aaa = setInterval(function () { // 获取视频播放到第几秒 function getOneDecimalPlace(num) { return Math.floor(num * 10) / 10; } videoCurrentTime = getOneDecimalPlace(videoObj.currentTime); // 设置视频无限轮播的范围 if (videoCurrentTime == loopEnd) { videoObj.currentTime = loopStart; } if (videoCurrentTime == loopStart - 1.1) { $(".e-module-202403261417").addClass("animate-v2"); } }, 100); } }, resizeEvent: function () { // 页面resize事件 var _this = this; var resizeWinw = 0; var resizeTimer = ''; this.win.on('resize', function () { var winw = _this.win.width(); if (winw != resizeWinw) { currentWinw = winw; // 删除之前的定时器 if (resizeTimer) { clearTimeout(resizeTimer); } // 添加新的定时器 resizeTimer = setTimeout(function () { // 调用函数 _this.resizeInit(); // 需要rezise的变量 _this.addVideoLink(_this.bannerObj.find('>.e-lazy')); }, 200) } }) } } module202403261417Obj.init(); } // 初始化 $('.e-module-202403261417').each(function () { // 防止js文件被执行2次。 var _this = $(this); if (_this.data('init')) { return; } _this.data('init', true); module202403261417Fun($(this)); }) } }) $(".e-module-202403261452 .con").hover(function () { var _this = $(this); if ($(window).width() > 1200) { if (_this.find("video").length == 0) { var videoStr = ""; _this.find(".video-box").append(videoStr); } else { _this.find("video")[0].play(); _this.find(".icon").css("zIndex", 1); } } }, function () { var _this = $(this); if (_this.find("video").length > 0) { _this.find("video")[0].pause(); _this.find(".icon").css("zIndex", 3); } }); if (winW > 1200) { var off202403261452 = true; $(window).on("scroll.e-module-202403261452", function () { if ($(window).scrollTop() + $(window).height() * 0.5 > $(".e-module-202403261452").offset().top) { if (off202403261452) { off202403261452 = false; $(".e-module-202403261452 .num").each(function () { var _this = $(this); var num = parseInt(_this.attr("data-num")); var cishu = parseInt(num / 50); var curNum = 0; if (cishu < 1) { cishu = 1; } var iTime = setInterval(function () { if (num < curNum + cishu) { clearInterval(iTime); _this.text(num); } else { _this.text(curNum += cishu); } }, 30) }) } } }) } else { $(".e-module-202403261452 .num").each(function () { var _this = $(this); var num = parseInt(_this.attr("data-num")); _this.text(num); }) } if (winW > 1200) { var off202403261439 = true; $(window).on("scroll.e-module-202403261439", function () { if ($(window).scrollTop() + $(window).height() * 0.5 > $(".e-module-202403261439").offset().top) { if (off202403261439) { off202403261439 = false; $(".e-module-202403261439 .num").each(function () { var _this = $(this); var num = parseInt(_this.attr("data-num")); var cishu = parseInt(num / 50); var curNum = 0; if (cishu < 1) { cishu = 1; } var iTime = setInterval(function () { if (num < curNum + cishu) { clearInterval(iTime); _this.text(num); } else { _this.text(curNum += cishu); } }, 30) }) } } }) } else { $(".e-module-202403261439 .num").each(function () { var _this = $(this); var num = parseInt(_this.attr("data-num")); _this.text(num); }) } $(window).on("scroll.scrollBottomTopAnimeta", function () { if (off) { off = false animateInit(); } scrollBottomTopAnimeta(); }); // 页面滚动动画:初始化 var animateInitsetTimeout = ''; var translateY1Obj = ''; var off = true; // 页面滚动动画:下到上 function scrollBottomTopAnimeta() { if (winW > 1200) { scrollTop = $(window).scrollTop(); for (var i = 0; i < boxTopAll.length; i++) { if (boxTopAll[i] < winH + scrollTop) { var topNum = numLine[i] + (boxTopAll[i] - winH - scrollTop); if (topNum < 2) { topNum = 0; } translateY1Obj.eq(i).css({ "transform": "translateY(" + topNum + "px)", "opacity": 1 - topNum / numLine[i] }); } } } } function animateInit() { translateY1Obj = $('.translateY1'); if (winW > 1200) { // 计算所有动画的位置 numLine = []; boxTopAll = []; winH = $(window).height(); // 初始化动画位置 translateY1Obj.each(function () { var _this = $(this); var num = _this.data('line') ? _this.data('line') : 200; numLine.push(num); _this.css("transform", "translateY(" + num + "px)"); }) clearTimeout(animateInitsetTimeout); animateInitsetTimeout = setTimeout(function () { translateY1Obj.each(function () { var _this = $(this); var num = _this.data('line') ? _this.data('line') : 200; boxTopAll.push(_this.parent().offset().top + num); }) scrollBottomTopAnimeta(); }, 400) } else { translateY1Obj.css("transform", "translateY(0px)"); } } animateInit(); // 导航 $("#mob-menubtn").on("click", function () { $('.main-header').addClass('open'); $('#close-menubtn').show(); $('#mob-menubtn').hide(); $('body').css('overflow', 'hidden') }) $("#close-menubtn").on("click", function () { closeMenu() }) //mob端关闭导航 function closeMenu() { // $('.nav-new').removeClass('active') $('.main-header').removeClass('open'); $('#close-menubtn').hide(); $('#mob-menubtn').show(); $('body').css('overflow', 'auto') // $('.logo img').attr('src', 'https://e.huawei.com/topic/sitecore/2023-mwc/img/banner/logo_huawei2.png'); // if ($(".bz-header").hasClass('fix')) { // $('.logo img').attr('src', 'https://e.huawei.com/topic/sitecore/2023-mwc/img/banner/logo_huawei.png'); // } } // 定位导航 function fixedNav() { // 基础对象 var winW = $(window).width(); // 对象 var navObj = $('.bz-header'); var liObj = navObj.find('.li'); var boxObj = $('.anchorpoint'); if ($('.e-module-202208270930').css('display') == 'block') { if (winW > 1600) { navObj.css("top", "52px"); } else { navObj.css("top", "42px"); } } else { navObj.css("top", 0); } $('.e-module-202208270930').on("click", function () { navObj.animate({ "top": 0 }); }) // 锚点定位,如果链接有带参数,自动触发点击事件 anchorFun(); // 点击导航栏按钮事件 liObj.on('click', function (e) { // 阻止时间冒泡 e.stopPropagation(); var _this = $(this); clickEvent(_this); }); // 滚动页面,导航栏跟着变化事件 $(window).on("scroll.bz-header", function () { // 获取滚动条当前位置 var scrollTop = $(window).scrollTop(); // // 显示、隐藏当前导航栏 if (scrollTop >= 20) { navObj.addClass('fix'); } else { navObj.removeClass('fix'); } // 获取每个版块的到页面顶部的位置 var anchorpointArr = []; boxObj.each(function () { anchorpointArr.push(Math.ceil($(this).offset().top - 80)); }) // 获取当前可预览的板块在哪个位置 var curLightHighIndex = 0; for (var i = 0; i < anchorpointArr.length; i++) { if (scrollTop >= anchorpointArr[i]) { curLightHighIndex = i; liObj.eq(curLightHighIndex).addClass('active').siblings().removeClass('active'); } else { curLightHighIndex = i; liObj.eq(curLightHighIndex).removeClass('active') } } // 当前导航栏跟着页面滚动高亮当前按钮 // liObj.eq(curLightHighIndex).addClass('active').siblings().removeClass('active'); }) function clickEvent(obj) { if (winW < 992) { closeMenu() } // 获取点击位置 var li_index = obj.index(); // 获取位置的top值 var willScrollTop = Math.ceil(boxObj.eq(li_index).offset().top - 80); // console.log(willScrollTop) // 执行动画 $("body,html").stop(true, true).animate({ "scrollTop": willScrollTop }, 300); // 高亮当前定位按钮 // obj.addClass('active').siblings().removeClass('active'); }; // 获取链接参数 function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); } // 锚点定位函数 function anchorFun() { var queryStr = getQueryString("section"); if (queryStr == undefined) return // 清除滚动条默认位置 if ('scrollRestoration' in history) { history.scrollRestoration = 'manual'; } liObj.each(function () { var _this = $(this); if (_this.data('key') == queryStr) { setTimeout(function () { _this.trigger('click'); }, 500) } }) } } function init() { fixedNav(); // 定位导航 } init(); var $backtop = $(".backtop"); $(window).on('scroll.backtop', function () { var high = $(window).scrollTop(); // 三元表达式进行高度判断 // if (winW > 1200) { high >= 700 ? $backtop.show() : $backtop.hide(); // } }) $backtop.on('click', function () { $("html, body").animate({ scrollTop: 0 }); }) // 交通指引 if ($(".e-module-202404180948").length > 0) { $(".e-module-202404180948 .tab-head ul li").on("click", function () { $(this).addClass("active").siblings().removeClass("active"); $(".e-module-202404180948 .tab-con > li").eq($(this).index()).addClass("active").siblings().removeClass("active"); // 设置色块的移动 var liW = $(this).outerWidth(); var curLiL = $(this).position().left; $(this).nextAll(".sekuai").css({ "width": liW, "left": curLiL }); }) $(".e-module-202404180948 .tab-head ul").append(""); if ($(".LANG-en").length > 0) { var liW = $(".e-module-202404180948 .tab-head ul li").eq(0).outerWidth(); var curLiL = $(".e-module-202404180948 .tab-head ul li").eq(0).position().left; } else { var liW = $(".e-module-202404180948 .tab-head ul li").eq(1).outerWidth(); var curLiL = $(".e-module-202404180948 .tab-head ul li").eq(1).position().left; } $(".e-module-202404180948 .sekuai").css({ "width": liW, "left": curLiL }); } // agenda if ($('.e-module-202404181550').length > 0) { function module202404181550Fun($target) { var module202404181550Obj = { init: function () { // 获取属性 this.win = $(window); this.moduleObj = $target; this.tablist = $target.find(".tablist"); this.tab = $target.find(".tab"); this.agendaBot = $target.find('.agenda-bottom'); this.listItem = $target.find('.list-item'); this.closePop = $target.find('.close-btn'); this.popCon = $target.find('.pop-con'); this.keynote1 = this.agendaBot.find('.keynote .day1').length; this.keynote2 = this.agendaBot.find('.keynote .day2').length; this.sum1 = this.agendaBot.find('.summit .day1').length; this.sum2 = this.agendaBot.find('.summit .day2').length; this.ses1 = this.agendaBot.find('.session .day1').length; this.ses2 = this.agendaBot.find('.session .day2').length; this.forum1 = this.agendaBot.find('.forum .day1').length; this.forum2 = this.agendaBot.find('.forum .day2').length; this.filSel = $target.find('.fil-sel'); this.resizeInit(); // resize初始化 this.addHtml(); this.clickEvent(); this.scrollEvent(); // 设置滚动事件,文字动画效果 this.resizeEvent(); // 设置自适应 this.lazyPicLink(); // 是否加载图片 this.tablist.append(""); this.tab.eq(0).find('.p2').css("opacity", 1); this.tab.eq(1).find('.p1').css("opacity", 1); var liW = this.tab.eq(0).outerWidth(); var curLiL = this.tab.eq(0).position().left; this.moduleObj.find(".sekuai").css({ "width": liW, "left": curLiL }); }, resizeInit: function () { this.winw = this.win.width(); this.winh = this.win.height(); // 获取位置 this.scrollTop = this.win.scrollTop(); this.moduleTop = this.moduleObj.offset().top; }, lazyPicLink: function () { // 加载图片 if (this.scrollTop + this.winh * 1.5 > this.moduleTop) { // 当滚动条滚动到当前位置时,加载视频 this.moduleSlideObj = this.moduleObj.find(".swiper-slide"); this.moduleSlideObj.each(function () { var $this = $(this); var imgObj = $this.find('img'); var src = imgObj.attr("data-original"); if (imgObj.attr("src") != src) { imgObj.attr("src", src) } }) } }, clickEvent: function () { var _this = this; _this.tab.click(function () { var $this = $(this); if (!$this.parent().hasClass("zanting")) { $this.parent().addClass("zanting"); if ($this.parent(".tablist").hasClass("preventClick")) { return; } var _index = $this.index(); $this.addClass('active').siblings().removeClass('active'); if (_index == 0) { _this.agendaBot.find('.day1').show(); _this.agendaBot.find('.day2').hide(); if (_this.keynote1 == 0) { _this.agendaBot.find('.keynote').hide(); } else { _this.agendaBot.find('.keynote').show(); } if (_this.sum1 == 0) { _this.agendaBot.find('.summit').hide(); } else { _this.agendaBot.find('.summit').show(); } if (_this.ses1 == 0) { _this.agendaBot.find('.session').hide(); } else { _this.agendaBot.find('.session').show(); } if (_this.forum1 == 0) { _this.agendaBot.find('.forum').hide(); } else { _this.agendaBot.find('.forum').show(); } } else { _this.agendaBot.find('.day2').show(); _this.agendaBot.find('.day1').hide(); if (_this.keynote2 == 0) { _this.agendaBot.find('.keynote').hide(); } else { _this.agendaBot.find('.keynote').show(); } if (_this.sum2 == 0) { _this.agendaBot.find('.summit').hide(); } if (_this.ses2 == 0) { _this.agendaBot.find('.session').hide(); } if (_this.forum2 == 0) { _this.agendaBot.find('.forum').hide(); } } // 设置色块的移动 var liW = $(this).outerWidth(); var curLiL = $(this).position().left; $(this).nextAll(".sekuai").css({ "width": liW, "left": curLiL }); $(this).find('.p1').css("opacity", 0); $(this).find('.p2').delay(200).animate({ "opacity": 1 }, 200); $(this).siblings().find('.p2').css("opacity", 0); $(this).siblings().find('.p1').animate({ "opacity": 1 }, 400); setTimeout(function () { $this.parent().removeClass("zanting"); }, 500) } }) _this.listItem.on('click', function () { $('body').append($(this).find('.agenda-item-pop').clone()).find('>.agenda-item-pop').show(); if (_this.winw < 992) { $(".agenda-item-pop .item-pop-cons .item-pop-con .pop-detail").css("max-height", _this.winh - $(".agenda-item-pop .item-pop-cons .item-pop-con .agenda-item-con").height() - 350); } }) $('body').on('click', ".item-pop-cons", function () { $('body').find('>.agenda-item-pop').remove(); }) $('body').on('click', '.item-close-btn', function () { $('body').find('>.agenda-item-pop').remove(); }) $('body').on('click', '.item-pop-con', function (e) { e.stopPropagation(); }) }, addHtml: function () { var _this = this; var box = this.moduleObj.find(".yc-list .list-item"); box.each(function (index) { var popBox = '
' + $(this).find('.agenda-item-con').html() + '
'; $(this).find('.item-pop-con .item-close-btn').after(popBox); if ($(this).find('.icon-dates img').data('xl') != '') { $(this).find('.icon-dates img').attr('src', $(this).find('.icon-dates img').data('xl')) } if ($(this).find('.icon1 img').data('xl') != '') { $(this).find('.icon1 img').attr('src', $(this).find('.icon1 img').data('xl')) } if ($(this).find('.icon2 img').data('xl') != '') { $(this).find('.icon2 img').attr('src', $(this).find('.icon2 img').data('xl')) } if ($(this).find('.icon3 img').data('xl') != '') { $(this).find('.icon3 img').attr('src', $(this).find('.icon3 img').data('xl')) } }) }, scrollEvent: function () { var _this = this; _this.win.on('scroll.202404181550', function () { // 获取位置 _this.scrollTop = _this.win.scrollTop(); _this.moduleTop = _this.moduleObj.offset().top; _this.lazyPicLink(); // 视频是否图片 }); }, resizeEvent: function () { // 页面resize事件 var _this = this; var resizeWinw = 0; var resizeTimer = ''; this.win.on('resize.202404181550', function () { var winw = _this.win.width(); if (winw != resizeWinw) { currentWinw = winw; // 删除之前的定时器 if (resizeTimer) { clearTimeout(resizeTimer); } // 添加新的定时器 resizeTimer = setTimeout(function () { _this.resizeInit(); // resize初始化 _this.scrollEvent(); // 设置滚动事件,文字动画效果 }, 100) } }) } }; module202404181550Obj.init(); } // 初始化 $('.e-module-202404181550').each(function () { // 防止js文件被执行2次。 var _this = $(this); if (_this.data('init')) { return; } _this.data('init', true); module202404181550Fun($(this)); }) } if ($(".LANG-en .e-module-202404180948").length > 0 && $(window).width() > 992) { $(".e-module-202404180948 .left ol").height($(".e-module-202404180948 .right .e-lazy").height()) } if ($(".backtop").length > 0) { var $backtop = $(".backtop"); var $slide = $('.slidebars'); $(window).on('scroll.backtop', function () { var high = $(window).scrollTop(); var bannerH = $('.e-module-202312151534').height(); var invitH = $('.e-module-202312191038').height(); var $high = '' if ($('.e-module-202312151534').length > 0) { $high = bannerH; } else { $high = invitH; } // console.log(invitH) if (high > $high) { $('.xiazai').addClass('active'); setTimeout(() => { $('.xiazai').addClass('hide'); $('.slidebars').addClass('active'); }, 5000); } high >= 700 ? $slide.fadeIn() : $slide.fadeOut(); }) $backtop.on('click', function () { $("html, body").animate({ scrollTop: 0 }); }) } // 合作伙伴 if ($('.e-module-202305251344').length > 0) { function module202305251344Fun($target) { var module202305251344Obj = { init: function () { // 获取属性 this.win = $(window); this.moduleObj = $target; this.resizeInit(); this.judgmentPcWap(); this.resizeEvent(); this.lazyPicLink(); this.scrollEvent(); }, resizeInit: function () { this.winw = this.win.width(); this.winh = this.win.height(); // 获取位置 this.scrollTop = this.win.scrollTop(); this.moduleTop = this.moduleObj.offset().top; }, judgmentPcWap: function () { this.clickEvent(); }, lazyPicLink: function () { // 加载图片 if (this.scrollTop + this.winh * 1.5 > this.moduleTop) { // 当滚动条滚动到当前位置时,加载视频 var moduleImgObj = this.moduleObj.find("img"); moduleImgObj.each(function () { var $this = $(this); var src = $this.attr("data-original"); if ($this.attr("src") != src) { $this.attr("src", src); $this.parent().addClass("over").css({ "height": "auto", "background": "none" }) } }) } }, scrollEvent: function () { var _this = this; _this.win.on('scroll.202305251344', function () { // 获取位置 _this.scrollTop = _this.win.scrollTop(); _this.moduleTop = _this.moduleObj.offset().top; _this.lazyPicLink(); // 视频是否图片 }); }, clickEvent: function () { var _this = this; // 获取对象 var closeBtn = this.moduleObj.find('.close-btn'); var point = this.moduleObj.find('.partner-item .imgs'); var popCons = this.moduleObj.find('.partner-item .pop-cons'); var popCon = this.moduleObj.find('.partner-item .pop-con'); point.on('click', function () { $('body').append($(this).parent().find('.pop').clone()).find('>.pop').show(); }) $('body').on('click', ".pop-cons", function () { $('body').find('>.pop').remove(); }) $('body').on('click', '.close-btn', function () { $('body').find('>.pop').remove(); }) $('body').on('click', '.pop-con', function (e) { e.stopPropagation(); }) // $('body').on('mouseup', function (e) { // if (!popCon.is(e.target) && popCon.has(e.target).length == 0) { // $('body').find('>.pop').remove(); // } // }) }, resizeEvent: function () { // 页面resize事件 var _this = this; var resizeWinw = 0; var resizeTimer = ''; this.win.on('resize.202209070955', function () { var winw = _this.win.width(); if (winw != resizeWinw) { currentWinw = winw; // 删除之前的定时器 if (resizeTimer) { clearTimeout(resizeTimer); } // 添加新的定时器 resizeTimer = setTimeout(function () { _this.resizeInit(); // resize初始化 _this.judgmentPcWap(); // 判断移动还是pc端 }, 100) } }) } }; module202305251344Obj.init(); } // 初始化 $('.e-module-202305251344').each(function () { // 防止js文件被执行2次。 var _this = $(this); if (_this.data('init')) { return; } _this.data('init', true); module202305251344Fun($(this)); }) } // speaker if ($('.e-module-202401161427').length > 0) { function module202401161427Fun($target) { var module202401161427Obj = { init: function () { // 获取属性 this.win = $(window); this.moduleObj = $target; this.moduleWrapperObj = this.moduleObj.find(".swiper-wrapper"); this.moduleSlideObj = this.moduleObj.find(".swiper-slide"); this.resizeInit(); // resize初始化 this.judgmentSwiper(); // 判断需不需要执行swiper this.scrollEvent(); // 设置滚动事件,文字动画效果 this.resizeEvent(); // 设置自适应 this.lazyPicLink(); // 是否加载图片 }, resizeInit: function () { this.winw = this.win.width(); this.winh = this.win.height(); // 获取位置 this.scrollTop = this.win.scrollTop(); this.moduleTop = this.moduleObj.offset().top; }, judgmentSwiper: function () { if (this.moduleSlideObj.length > 1) { if (this.moduleObj.data("swiper-init")) { return; } this.moduleObj.data("swiper-init", true); this.initSwiper(); } }, lazyPicLink: function () { // 加载图片 if (this.scrollTop + this.winh * 1.5 > this.moduleTop) { // 当滚动条滚动到当前位置时,加载视频 this.moduleSlideObj = this.moduleObj.find(".swiper-slide"); this.moduleSlideObj.each(function () { var $this = $(this); var imgObj = $this.find('img'); var src = imgObj.attr("data-original"); if (imgObj.attr("src") != src) { imgObj.attr("src", src) } }) } }, initSwiper: function () { var _this = this; // 每次滚动的数量 var slidesPerGroup = 2; if (_this.winw > 992) { slidesPerGroup = 4; } var slideLength = $target.find(".swiper-slide").length; var mySwiper = new Swiper($target.find(".swiper"), { watchOverflow: true, // 一屏不显示左右箭头以及pagination spaceBetween: 20, // 板块与板块之间的间距 slidesPerView: 2, //没屏幕显示的个数 resistanceRatiao: 1, //触底不反弹 slidesPerGroup: slidesPerGroup, // 每次轮播的个数 autoplay: $target.data("auto-time") ? { delay: $target.data("auto-time"), stopOnLastSlide: false, disableOnInteraction: true } : false, loop: slideLength > 2 ? true : false, // 设置自动轮播 noSwiping: slideLength > 1 ? false : true, // 如果需要前进后退按钮 navigation: { nextEl: $target.find('.swiper-button-next'), prevEl: $target.find('.swiper-button-prev'), }, pagination: { // 设置点点点 el: $target.find('.swiper-pagination'), clickable: true, }, breakpoints: { 1200: { slidesPerView: 4, spaceBetween: 40, loop: slideLength > 4 ? true : false, // 设置自动轮播 }, 992: { slidesPerView: 4, spaceBetween: 20, loop: slideLength > 4 ? true : false, // 设置自动轮播 }, }, on: { init: function () { if (_this.winw > 992) { if (_this.moduleSlideObj.length < 5) { $target.find('.swiper-button').hide(); $target.find('.swiper-wrapper').css('justify-content', 'space-around'); if (_this.winw > 992 && _this.winw < 1200) { $target.find('.swiper-pagination').hide(); } } } else { if (_this.moduleSlideObj.length < 3) { $target.find('.swiper-pagination').hide(); } } }, resize: function () { var This = this; setTimeout(function () { // 不同屏幕下,轮播个数 if (_this.winw > 992) { slidesPerGroup = 4; } else { slidesPerGroup = 2; } This.emit('init'); This.update(); //窗口变化时,更新Swiper的一些属性,如宽高等 }, 150) }, paginationRender: function () { // 分页器渲染了 if ($target.find(".swiper-point .num .numcurrent").length == 0) { var numStr = "01/0" + $target.find(".swiper-pagination-bullet").length + ""; $target.find(".swiper-point .num").prepend(numStr) } } } }); //鼠标覆盖停止自动切换 mySwiper.el.onmouseover = function () { mySwiper.autoplay.stop(); } //鼠标离开开始自动切换 mySwiper.el.onmouseout = function () { mySwiper.autoplay.start(); } // 添加切换后的回调 mySwiper.on('slideChangeTransitionEnd', function () { // 这里是切换后的回调代码 $target.find(".swiper-point .num .numcurrent").text("0" + ($target.find(".swiper-pagination-bullet-active").index() + 1)) }); }, scrollEvent: function () { var _this = this; _this.win.on('scroll.202401161427', function () { // 获取位置 _this.scrollTop = _this.win.scrollTop(); _this.moduleTop = _this.moduleObj.offset().top; _this.lazyPicLink(); // 视频是否图片 }); }, resizeEvent: function () { // 页面resize事件 var _this = this; var resizeWinw = 0; var resizeTimer = ''; this.win.on('resize.202401161427', function () { var winw = _this.win.width(); if (winw != resizeWinw) { currentWinw = winw; // 删除之前的定时器 if (resizeTimer) { clearTimeout(resizeTimer); } // 添加新的定时器 resizeTimer = setTimeout(function () { _this.resizeInit(); // resize初始化 _this.judgmentSwiper(); // 判断需不需要执行swiper _this.scrollEvent(); // 设置滚动事件,文字动画效果 }, 100) } }) } }; module202401161427Obj.init(); } // 初始化 $('.e-module-202401161427').each(function () { // 防止js文件被执行2次。 var _this = $(this); if (_this.data('init')) { return; } _this.data('init', true); module202401161427Fun($(this)); }) } })