Сообщение от مراد
|
без кнопки как запустить?
|
<!DOCTYPE HTML>
<html>
<head><meta charset="utf-8">
</head>
<body>
<div id="URbe4">
<span class="a">Бла бла бла </span><span class="hour"> hh</span>:<span class="min">mm</span>:<span class="sec">ss</span>
</div>
<script>
var timerId;
function update() {
var clock = document.getElementById('URbe4');
var sebastian = document.getElementById('URbe4');
var date = new Date();
var h = date.getHours();
var hours = date.getHours();
var minutes = date.getMinutes();
var seconds = date.getSeconds();
if (h === 16 && minutes > 0) {h = 'Бла бла бла '; sebastian.children[0].innerHTML = h;}
else
if (h === 16 && minutes > 45){ h = 'Разная суета... '; sebastian.children[0].innerHTML = h;}
else
if (h === 16 && minutes > 50){ h = 'Тоже суета '; sebastian.children[0].innerHTML = h;}
else
if (h === 17 && minutes < 30) {h = 'Еще большая суета.. '; sebastian.children[0].innerHTML = h;}
else {h = '..........всякое разное....... '; sebastian.children[0].innerHTML = h;}
if (hours < 10) hours = '0'+hours; clock.children[1].innerHTML = hours;
if (minutes < 10) minutes = '0'+minutes; clock.children[2].innerHTML = minutes;
if (seconds < 10) seconds = '0'+seconds; clock.children[3].innerHTML = seconds;
}
function URbe4Start() {
if (timerId) return;
timerId = setInterval(update, 1000);
update();
}
</script>
</body onload="URbe4Start()" >
</html>