en.javascript.info/2-ui/5-widgets/2-widgets-structure/1-clock/source.view/index.html
2015-03-09 19:02:13 +03:00

43 lines
No EOL
973 B
HTML
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE HTML>
<html>
<head>
<title>Часики</title>
<meta charset="utf-8">
<style>
.hour {
color: green
}
.min {
color: blue
}
.sec {
color: red
}
</style>
</head>
<body>
<div id="clock" class="clock">
<span class="hour">00</span>:<span class="min">00</span>:<span class="sec">00</span>
</div>
<script>
// .. ваш код Clock
var pageClock = new Clock({
elem: document.getElementById('clock')
});
</script>
<input type="button" onclick="pageClock.start()" value="Старт">
<input type="button" onclick="pageClock.stop()" value="Стоп">
<input type="button" onclick="alert('Часы должны останавливаться во время alert,\nи продолжать корректно работать после нажатия на ОК')" value="alert для проверки корректного возобновления">
</body>
</html>