$(function() { var time = setinterval(function() { if ($('.ctn5 .p_rollslide').length) { $('.ctn5 .p_rollslide').addclass('clearfix'); clearinterval(time); } }, 10) $('.ctn1 .con .t-more').click(function() { $('.ctn1 .con .text').addclass('active'); $(this).hide(); }); var countcxarr = []; var countcx = function() { $('.numcount').each(function(i, dom) { if (countcxarr[i] && countcxarr[i] === true) { return; } var st; var nctop; st = $(window).scrolltop(); nctop = $(dom).offset().top; var id, decimals, startval, endval, duration; if (st > nctop - $(window).height() && st < nctop) { $(dom).find('.numcx').each(function() { id = $(this).attr('id'); decimals = $(this).attr('data-decimals'), startval = $(this).attr('data-startval'), endval = $(this).attr('data-endval'), duration = $(this).attr('data-speed'); new countup(id, startval, endval, decimals, duration, { useeasing: true, //效果 separator: ',' //数字分隔符 }).start(); // target:目标元素id, startval:你想要开始的值, endval:你想要到达的值, decimals:小数位数,默认值为0, duration:动画持续时间为秒,默认值为2, options:选项的可选对象 countcxarr[i] = true; }) } }) } // countcx(); $(window).on("scroll", function() { countcx(); }); $require(['swiper'],function(){ var ctn4_swiper = new swiper('.ctn4 .swiper-container', { speed: 1000, autoplay: { delay: 7000, stoponlastslide: false, disableoninteraction: false, }, pagination: { el: '.ctn4 .swiper-pagination', clickable: true, }, navigation: { nextel: '.ctn4 .swiper-button-next', prevel: '.ctn4 .swiper-button-prev', } }); var ctn5_swiper = new swiper('.ctn5 .swiper-container', { speed: 1000, autoplay: { delay: 7000, stoponlastslide: false, disableoninteraction: false, }, pagination: { el: '.ctn5 .swiper-pagination', clickable: true, } }); }) })