יש לי עוד שאלה (javascript)
הודעה זו נכתבה על-ידי ההורס659 בתאריך: 15.04.08 - שעה: 19:11:49
אני עושה שעון באתר(אני מנסה לעשות שעון בהטמל) ואני לא מצליח אני עושה את זה ככה --------------------------------------------------------------------- <html> <head> <title>שעון</title> </head> <body> <script language="javascript"> var timerID = null var timerRunning = false function timeNow() { now = new Date() hours = now.getHours() minutes = now.getMinutes() seconds = now.getSeconds() timeStr = "" + ((hours > 12) ? hours - 12 : hours) timeStr += ((minutes < 10) ? ":0" : ":") + minutes timeStr += ((seconds < 10) ? ":0" : ":") + seconds timeStr += (hours >= 12) ? " PM" : " AM" return timeStr }
function startTimer(){ stopTimer() runClock() }
function stopTimer(){ if(timerRunning) { clearTimeout(timerID) timerRunning = false } }
function runClock(){ document.Zooloo.ZoolooClock.value = timeNow() timerID = setTimeout("runClock()",1000) timerRunning = true } <script>
<CENTER> <input type="text" name="ZoolooClock" size="11"> </CENTER> </body> </html> --------------------------------------------------------------------- בבקשה תעזרו לי
| |