function stopBubble(e) { // 如果传入了事件对象,那么就是非ie浏览器 if (e && e.stopPropagation) { //因此它支持W3C的stopPropagation()方法 e.stopPropagation(); } else { //否则我们使用ie的方法来取消事件冒泡 window.event.cancelBubble = true; } } //实现滚动条无法滚动 var mo = function(e) { e.preventDefault(); }; /***禁止滑动***/ function scrollStop() { document.body.style.overflow = 'hidden'; document.addEventListener("touchmove", mo, false); //禁止页面滑动 } /***取消滑动限制***/ function scrollMove() { document.body.style.overflow = ''; //出现滚动条 document.removeEventListener("touchmove", mo, false); } // 是否有touch事件 var tap = 'click'; $(window).load(function() { var isTouch = "ontouchstart" in document ? true : false; if (isTouch) { tap = 'touchstart'; } else { tap = 'click'; } return tap; }); $(window).load(function() { reszepro() gotopFn(); }); /// 浏览器变化 $(window).resize(function() { reszepro() var ww = $(window).width(); if (ww > 991) { // ... } }); $(function() { var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset: 0, live: true }); wow.init(); var mySwiper = new Swiper('.pc-banner', { speed: 800, autoplay: { delay: 5000, }, effect: 'slide', pagination: { el: '.swiper-pagination', clickable: true }, on: { init: function() { swiperAnimateCache(this); //隐藏动画元素 swiperAnimate(this); //初始化完成开始动画 }, slideChange: function(swiper) { if (this.activeIndex == 2) { console.log(3) } swiperAnimate(this); //每个slide切换结束时也运行当前slide动画 } }, lazy: { loadPrevNext: true, }, }); var $line = $('.the-bg-fixed .line'); $('.product-select').hover(function() { //var offsetTop = $(this).position().top; //$line.animate({ top: offsetTop }, 100); $(this).addClass('active').siblings('').removeClass('active'); //$(".product-desc-box").eq($(this).index()).addClass('fadeInRight animated').siblings('').removeClass('fadeInRight animated wow').removeAttr('style'); $(".product-desc-box").eq($(this).index()).siblings('').hide(); $(".product-desc-box").eq($(this).index()).show(); }); if($(".pc-banner .swiper-slide").length<=1){ $('.pc-banner .swiper-pagination').hide() } }); function reszepro() { var l_h = $('.product-left-list').height(); $('.product-desc-box').each(function(index, el) { var len = $(el).find("ul>li").length; var h = l_h / len; $(el).find("ul>li").each(function(index, el) { var li = $(el).find('.inner'); li.css({ 'height': h + 'px', 'line-height': h + 'px' }) }); }); var off_l = $('.l-logo').offset().left; //$('.product-left-list').css('padding-left', off_l + 20 + 'px'); $("#solu-prev").css('left', off_l - 60 + 'px'); $("#solu-next").css('right', off_l - 50 + 'px') } // 2019/10/23新增解决方案swiper滑块 if ($('.solution-item ').length > 4) { var mySwiper = new Swiper('.solution-list', { autoplay: false, spaceBetween: 10, slidesPerView: 4, slidesPerGroup: 4, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', } }); }else{ $(".solution-control-btn").hide() }