сейчас на сайте:
Лучшие сказки мира
Детектив и фантастика
Песни прошлых лет
Для досуга
смотреть оглавлениепримерразмер кода
<div style="width:150px; height:30px; background-image:url(yourimage.jpg)"><div id="clock" style="position:relative; left:50px; top:0px;font-weight:bold; color:#8e8462; font-size:12px"></div></div>
The image is used as a background for a layer. This layer should be made the same size as the image.
Nested inside this layer is the clock layer, by using a relative position the clock can be placed anywhere on your image by adjusting the left and top attributes.
<script type="text/javascript"> <!-- function showtime1(){ var now = new Date() var hours = now.getHours() var minutes = now.getMinutes() var seconds = now.getSeconds() //var timeValue = " " + (hours > 12 ? hours - 12 : hours) var timeValue = hours timeValue += (minutes < 10 ? ":0" : ":") + minutes timeValue += (seconds < 10 ? ":0" : ":") + seconds //timeValue += (hours >= 12 ? " p.m." : " a.m.") timerID = setTimeout("showtime1()",1000) document.getElementById("clock").innerHTML= timeValue } //--> </script>