차가운바람님 봐주세요 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

차가운바람님 봐주세요 정보

차가운바람님 봐주세요

첨부파일

jquery-timer-demo.zip (218.9K) 4회 다운로드 2013-11-25 17:30:19

본문

예제중 Example2 에 랜덤 출력좀 도와주세요
  • 복사

댓글 전체

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="author" content="Jason Chavannes" />
    <title>jQuery Timer Demo</title>
   
    <link rel="stylesheet" href="res/style.css" />
    <script type="text/javascript" src="res/jquery.min.js"></script>
    <script type="text/javascript" src="jquery.timer.js"></script>
    <script type="text/javascript" src="res/demo.js"></script>
</head>
<body>
<script>
function getRandom(max, min) {
    return Math.floor(Math.random()*(max-min)) + min;
}
$(function() {
    var rand = getRandom(100,300);
    $('#startTime').val(rand);

});
</script>

    <h1>jQuery Timer Demo</h1>
    <p>Project home: <a href="http://jchavannes.com/jquery-timer" target="_blank">http://jchavannes.com/jquery-timer</a></p>
    <p><a href="res/demo.js" target="_blank">View Source</a></p>

    <hr/><h3 style='margin-top:20px;'>Example 1 - Stopwatch (counts ups)</h3>
    <span id="stopwatch">00:00:00</span>
    <p>
        <input type='button' value='Play/Pause' onclick='Example1.Timer.toggle();' />
        <input type='button' value='Stop/Reset' onclick='Example1.resetStopwatch();' />
    </p>
    <br/>
    <br/>

    <h3>Example 2 - Countdown Timer</h3>
    <span id="countdown">05:00:00</span>
    <form id="example2form">
        <input type='button' value='Play/Pause' onclick='Example2.Timer.toggle();' />
        <input type='button' value='Stop/Reset' onclick='Example2.resetCountdown();' />
        <input type='text' name='startTime' id='startTime' value='' style='width:30px;' />
    </form>

추가된 내용은
<script>
function getRandom(max, min) {
    return Math.floor(Math.random()*(max-min)) + min;
}
$(function() {
    var rand = getRandom(100,300);
    $('#startTime').val(rand);

});
</script>

그리고
<input type='text' name='startTime' id='startTime' value='' style='width:30px;' />
입니다
© SIRSOFT
현재 페이지 제일 처음으로