<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/waypoints/2.0.3/waypoints.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Counter-Up/1.0.0/jquery.counterup.min.js"></script>
<script>
$(function(){
let $count = $('.world__number--item.country .num'); // 카운트할 부분
$count.counterUp({
delay: 10,
time: 900
});
})
</script>
아래 내용 버전 문제로 오류 생기는 거 같아서 위 내용으로 ㄱㄱ
<script src="https://cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.0/jquery.waypoints.min.js"></script>
<script src="/asset/js/jquery.counterup.min.js"></script> <!-- 파일 추가 필요 -->
<script>
$(function(){
let $count = $('.world__number--item.country .num'); // 카운트할 부분
$count.counterUp({
delay: 10,
time: 900
});
})
</script>
출처: https://www.npmjs.com/package/jquery.counterup?activeTab=readme
728x90