1000단위 콤마..ㅠㅠ 채택완료
.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
위코드를 붙히면 콤마를 붙힐 수 있는 것 같긴한데,,
현재 숫자애니메이션 넣어놔서 그런가 적용이 안되네요ㅠㅠ
어떻게 적용해야할까요...ㅠㅠ
Copy
let count = 0;
pointCheck();
function pointCheck() {
const qaz = window.scrollY || window.pageXOffset;
if (
document.getElementById("count_wrap").getBoundingClientRect().bottom = 1) {
return;
}
count++;
var cnt0 = 31900;
counterFn();
function counterFn() {
function count0Fn() {
cnt0++;
if (cnt0 > 31963) {
clearInterval(id0);
} else {
document.getElementsByClassName("number")[0].innerHTML = cnt0;
$(".number").text(cnt0);
}
}
id0 = setInterval(count0Fn, 10);
}
} else if (
document.getElementById("count_wrap").getBoundingClientRect().top >
qaz
) {
count = 0;
$(".number").text(31963);
}
}
window.onscroll = pointCheck;
답변 2개
답변을 작성하려면 로그인이 필요합니다.
로그인