$(function() { /** function scroll(){ var num1 = $('.nums .num_1').html() * 1 var num1_target=($('.nums .num_1').attr('tnum'))*1 if (!num1) { var t1 = setInterval(function() { num1 = num1 + 1 if (num1 > num1_target) { num1 = num1_target clearInterval(t1) } $('.nums .num_1').html(num1) }, 7000/60) } var num2 = $('.nums .num_2').html() * 1 var num2_target=($('.nums .num_2').attr('tnum'))*1 if (!num2) { var t2 = setInterval(function() { num2 = num2 + 4 if (num2 > num2_target) { num2 = num2_target clearInterval(t2) } $('.nums .num_2').html(num2) }, 7000/num2_target*4) } var num3 = $('.nums .num_3').html() * 1 var num3_target=($('.nums .num_3').attr('tnum'))*1 if (!num3) { var t3 = setInterval(function() { num3 = num3 +1 if (num3 > num3_target) { num3 = num3_target clearInterval(t3) } $('.nums .num_3').html(num3) }, 7000/num3_target) } var num4 = $('.nums .num_4').html() * 1 var num4_target=($('.nums .num_4').attr('tnum'))*1 if (!num4) { var t4 = setInterval(function() { num4 = num4 + 1 if (num4 > num4_target) { num4 = num4_target clearInterval(t4) } $('.nums .num_4').html(num4) }, 7000/num4_target) } } $(window).scroll(function() { var scrolltop = $(window).scrollTop() //console.log(scrolltop) $('.adv').each(function() { var this_top = $(this).offset().top if ((scrolltop * 1 + $(window).height() - 180) > this_top) { scroll() } }) }) **/ 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锛氱洰鏍囧厓绱爄d, startVal锛氫綘鎯宠寮€濮嬬殑鍊? endVal锛氫綘鎯宠鍒拌揪鐨勫€? decimals锛氬皬鏁颁綅鏁帮紝榛樿鍊间负0, duration锛氬姩鐢绘寔缁椂闂翠负绉掞紝榛樿鍊间负2, options锛氶€夐」鐨勫彲閫夊璞 countCXArr[i] = true; }) } }) } countCX(); $(window).on("scroll",function() { countCX(); }) //浠ヤ笅涓烘湁鐢 var winwidth = $(window).width() var winheight = $(window).height() /* 棣栭〉杞挱*/ var mySwiper = new Swiper('.index-slider', { loop: true, // 寰幆妯″紡閫夐」 autoplay:true, pagination: { el: '.swiper-pagination', clickable: true, } /* navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }*/ }) /*棣栭〉杞挱楂樺害*/ /*var index_banner_height = $(window).width() * 1080 / 1920; $('.index-slider-top .swiper-slide').css({ 'height': index_banner_height + 'px' }) if (index_banner_height > $(window).height()) { $('.top_wrapper').css({ 'margin-top': (index_banner_height - $(window).height()) / 1 * -1 + 'px' }) }*/ //鏍稿績浜у搧鐗硅壊鑿 var galleryThumbs = new Swiper('.gallery-thumbs', { spaceBetween: 0, loop: true, slidesPerView: 4, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, /* freeMode: true, loop: true,*/ direction: 'vertical', watchSlidesVisibility: true, /* watchSlidesProgress: true, */ }); var galleryTop = new Swiper('.gallery-top', { spaceBetween: 0, navigation: { /*nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev',*/ }, thumbs: { swiper: galleryThumbs } }); })