JapanBlog - forum

JapanBlog - forum

Объявление

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.


Вы здесь » JapanBlog - forum » Скрипты » Часики графические


Часики графические

Сообщений 1 страница 2 из 2

1

<html>
<head>
<title>Часики графические</title>
<script language="JavaScript">
<!--
document.write(setClock())
function setClock() {
var text = ""
var openImage = "<IMG SRC=\"" + getPath(location.href) + "../img/dg"
var closeImage = ".gif\" HEIGHT=21 WIDTH=16>"
var now = new Date()
var hour = now.getHours()
var minute = now.getMinutes()
now = null
var ampm = ""
if (hour >= 12) {
hour -= 12
ampm = "pm"
} else
ampm = "am"
hour = (hour == 0) ? 12 : hour
if (minute < 10)
minute = "0" + minute
// do not parse this number!
minute += ""
hour += ""
for (var i = 0; i < hour.length; ++i) {
text += openImage + hour.charAt(i) + closeImage
}
text += openImage + "c.gif\" HEIGHT=21 WIDTH=9>"
for (var i = 0; i < minute.length; ++i) {
text += openImage + minute.charAt(i) + closeImage
}
text += openImage + ampm + closeImage
return text}function getPath(url) {
lastSlash = url.lastIndexOf("/")
return url.substring(0, lastSlash + 1)}
// --></script>
</body>
</html>

0

2

Код:
<html>
<head>
<title>Часики графические</title>
<script language="JavaScript">
<!--
document.write(setClock())
function setClock() {
var text = ""
var openImage = "<IMG SRC=\"" + getPath(location.href) + "../img/dg"
var closeImage = ".gif\" HEIGHT=21 WIDTH=16>"
var now = new Date()
var hour = now.getHours()
var minute = now.getMinutes()
now = null
var ampm = ""
if (hour >= 12) {
hour -= 12
ampm = "pm"
} else
ampm = "am"
hour = (hour == 0) ? 12 : hour
if (minute < 10)
minute = "0" + minute
// do not parse this number!
minute += ""
hour += ""
for (var i = 0; i < hour.length; ++i) {
text += openImage + hour.charAt(i) + closeImage
}
text += openImage + "c.gif\" HEIGHT=21 WIDTH=9>"
for (var i = 0; i < minute.length; ++i) {
text += openImage + minute.charAt(i) + closeImage
}
text += openImage + ampm + closeImage
return text}function getPath(url) {
lastSlash = url.lastIndexOf("/")
return url.substring(0, lastSlash + 1)}
// --></script>
</body>
</html>

0


Вы здесь » JapanBlog - forum » Скрипты » Часики графические