Логин:   Пароль:






Новости
Рассылки
Форум
Поиск


Java
- Апплеты
- Вопрос-ответ
- Классы
- Примеры
- Руководства
- Статьи
- IDE
- Словарь терминов
- Скачать

Мобильная Java
- Игры
- Примеры
- Статьи
- WAP, WML и пр.

JavaScript
- Вопрос-ответ
- Примеры
- Статьи

Веб-мастеринг
- HTML
- CSS
- SSI

Разминка для ума
Проекты
Книги
Ссылки
Программы
Юмор :)




Rambler's Top100
Rambler's Top100

JavaScript: ПримерыЧасики на страничке

Часики на страничке




Ниже идёт сам код, который необходимо разместить на страничке:


<html>
<head>

<script>
<!--


function showTime()
{

dayTwo = new Date();
hrNow = dayTwo.getHours();
mnNow = dayTwo.getMinutes();	
scNow = dayTwo.getSeconds();
miNow = dayTwo.getTime();
if (hrNow == 0) 
	{
	hour = 0;
	ap = " AM";
	}

else if(hrNow <= 11) 
	{
	ap = " AM";
	hour = hrNow;
	} 

else if(hrNow == 12) 
	{
	ap = " PM";
	hour = 12;
	} 

else if (hrNow >= 13) 
	{
	hour = (hrNow - 12);
	ap = " PM";
	}

if (hrNow >= 13) 
	{
	hour = hrNow - 12;
	}

if (mnNow <= 9) 
	{
	min = "0" + mnNow;
	}

else (min = mnNow)
if (scNow <= 9) 
{
secs = "0" + scNow;
} 

else 
{
secs = scNow;
}
time = hour + ":" + min + ":" + secs ;


if(document.all)
	{
	document.all.clock.innerHTML=time;
	document.all.clock1.innerHTML=time;
	}


if(document.layers)
	{
document.clock.document.write('<p style=\"font-size:10px; font-weight:bold; font-family:Verdana; 
                               color:#a0a0a0;\">' + time + '<\/p>');
document.clock1.document.write('<p style=\"font-size:10px; z-index:-1; position:absolute; 
                                top:1; left:1; font-weight:bold; font-family:Verdana;
				 color:#11a6ff;\">' + time + '<\/p>');
document.clock.document.close();
document.clock1.document.close();

	}


setTimeout('showTime()', 1000);

}


// -->
</script>
</head>
<body onLoad="showTime()">
<div id="clock" style="position: absolute; top: 115; left: 13; color: #11a6ff; font-family: Verdana; 
                          font-size: 20px; font-weight: bold; width: 110; height: 33">
</div>
<div id="clock1" style="position: absolute; z-index: -1; top: 117; left: 15; color: 
  #a0a0a0; font-family: Verdana; font-size: 20px; font-weight: bold; width: 120; height: 30">
</div>

</body>
</html>

Взято с домашней странички Ирландца


Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /pub/home/javaport/javaportal/books/show2b.php on line 11

Warning: mysql_db_query() [function.mysql-db-query]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /pub/home/javaport/javaportal/books/show2b.php on line 19

Warning: mysql_db_query() [function.mysql-db-query]: A link to the server could not be established in /pub/home/javaport/javaportal/books/show2b.php on line 19

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /pub/home/javaport/javaportal/books/show2b.php on line 30
Узнай о чем ты на самом деле сейчас думаешь тут.


[an error occurred while processing this directive]



Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /pub/home/javaport/javaportal/news/worldnews.php on line 91

Warning: mysql_db_query() [function.mysql-db-query]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /pub/home/javaport/javaportal/news/worldnews.php on line 93

Warning: mysql_db_query() [function.mysql-db-query]: A link to the server could not be established in /pub/home/javaport/javaportal/news/worldnews.php on line 93

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /pub/home/javaport/javaportal/news/worldnews.php on line 95