jquery 타이머 만들기
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script>
function setTimer(selector,startValue,endValue,durationTime){
$(selector).animate(
{
to:startValue,
from:endValue
},
{
duration:durationTime,
step:function(idx){
$(this).text(Math.floor(idx));
}
}
);
}
$(function(){
setTimer(".timer1",0,500,1000);
setTimer(".timer2",0,5000,2000);
setTimer(".timer3",0,50000,3000);
setTimer(".timer4",0,500000,4000);
setTimer(".timer5",0,5000000,5000);
// 선택자,시작값,끝값,지연시간
});
</script>
<div class='timer1'></div>
<div class='timer2'></div>
<div class='timer3'></div>
<div class='timer4'></div>
<div class='timer5'></div>
animate함수로 간단하게 구현이 가능 합니다.
댓글 2개
감사합니다.
게시판 목록
개발자팁
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 5036 | 웹서버 | 4년 전 | 2136 | ||
| 5035 | 웹서버 | 4년 전 | 2165 | ||
| 5034 | 웹서버 | 4년 전 | 2396 | ||
| 5033 | 웹서버 | 4년 전 | 1776 | ||
| 5032 | 웹서버 | 4년 전 | 2131 | ||
| 5031 | 웹서버 | 4년 전 | 2511 | ||
| 5030 | MySQL | 4년 전 | 2880 | ||
| 5029 | 웹서버 | 4년 전 | 7173 | ||
| 5028 | 웹서버 |
kerimdoor
|
4년 전 | 1627 | |
| 5027 | OS | 4년 전 | 6548 | ||
| 5026 | PHP |
|
4년 전 | 4636 | |
| 5025 | JavaScript |
|
4년 전 | 2400 | |
| 5024 | MySQL |
|
4년 전 | 3810 | |
| 5023 | MySQL | 4년 전 | 3027 | ||
| 5022 | PHP | 4년 전 | 2319 | ||
| 5021 | PHP |
|
4년 전 | 3246 | |
| 5020 | PHP | 4년 전 | 4301 | ||
| 5019 | PHP | 5년 전 | 4323 | ||
| 5018 | 웹서버 | 5년 전 | 6700 | ||
| 5017 | 기타 |
HappyTank
|
5년 전 | 5066 | |
| 5016 | MySQL | 5년 전 | 3080 | ||
| 5015 | 기타 | 5년 전 | 2268 | ||
| 5014 | 기타 | 5년 전 | 2831 | ||
| 5013 | 기타 | 5년 전 | 2250 | ||
| 5012 | 기타 | 5년 전 | 2256 | ||
| 5011 | 기타 | 5년 전 | 2211 | ||
| 5010 | 기타 | 5년 전 | 1770 | ||
| 5009 | 기타 | 5년 전 | 2377 | ||
| 5008 | 기타 | 5년 전 | 2006 | ||
| 5007 | 기타 | 5년 전 | 1971 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기