countup.js 질문

countup.js 질문

QA

countup.js 질문

본문

안녕하세요.

countup.js사용시 문제가있어 질문드립니다.


<script>
$(".count_num").countUp();
</script>
<span class="count_num">123,456,789</span>

이렇게 하면 정상작동 잘되나,


<script>
$(".btn").click(function(){
 $(".count_num").countUp();
});
</script>
<span class="count_num">123,456,789</span>
<button class="btn">버튼</button>

와 같이 클릭시에 이벤트를 주면 클릭시에는 문제가없으나

더블클릭 or 광클할시 123,456,789의 값이 점점 변형되는데

해결 방법 조언좀 부탁드릴게요 ㅠㅠ

 

이 질문에 댓글 쓰기 :

답변 1


<script>
$(".btn").click(function(){
    $(this).prop("disabled", true);
    
    $(".count_num").countUp();
    
    setTimeout(function(){
        $(this).prop("disabled", false);
    }, 1000);
});
</script>
<span class="count_num">123,456,789</span>
<button class="btn">버튼</button>
답변을 작성하시기 전에 로그인 해주세요.
전체 97
QA 내용 검색
filter #java ×

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT