$(function () { //轮播图 // var swiper1 = new Swiper(".Swiper1", { // loop: false, // grabCursor: true, // speed: 600, // spaceBetween: 0, // observer: true, // observeParents: true, // navigation: { // nextEl: ".next1", // prevEl: ".prev1", // }, // pagination: { // el: '.one', // type: 'progressbar' // }, // lazy: { // loadPrevNext: true, // }, // on: { // init: function () { // swiperAnimateCache(this); //隐藏动画元素 // swiperAnimate(this); //初始化完成开始动画 // }, // slideChangeTransitionEnd: function () { // swiperAnimate(this); //每个slide切换结束时也运行当前slide动画 // } // } // }); var lis = $('.case-content li'); lis.on('click', function () { let $this = $(this); $this.addClass('active'); $this.siblings().removeClass('active'); }) //数字++ $(window).on('scroll', function () { var oTop = $('.nums').offset().top, oHeight = $('.nums').innerHeight(), screenScroll = $(window).scrollTop(), screenHeight = $(window).height(); if (($('.timer').text() == "") && (screenScroll < oTop + oHeight / 3 * 2) && (screenScroll + screenHeight > oTop + oHeight / 3)) { $('.timer').each(count); } }) })