 20.05.2008 21:19 | #1 |
| | LupusNox
На форуме с 18.05.2008 Сообщений: 12 Профиль | Часы, формат вывода 12:13:59| Цитата: | <html>
<head>
<title>Время.</title>
<script language="JavaScript">
<!--
ndata = new Date();
hours = ndata.getHours();
mins = ndata.getMinutes();
secs = ndata.getSeconds();
if (hours < 10) {hours = "0" + hours }
if (mins < 10) {mins = "0" + mins }
if (secs < 10) {secs = "0" + secs }
datastr = ( hours + ":" + mins + ":"+secs )
-->
</script>
</head>
<body>
<font face="Arial" size="3" color="#b00000">
<script language="JavaScript">
<!--
document.write(datastr);
-->
</script>
</font>
</body>
</html> | Дизайн Scriptic. |
|
|
 |
 20.05.2008 21:21 | #2 |
| | LupusNox
На форуме с 18.05.2008 Сообщений: 12 Профиль | Часы в форме, формат вывода 12:13:59| Цитата: | <html>
<head>
<title>Время.</title>
</head>
<body onLoad="myclock()">
<script language="JavaScript">
<!--
function myclock()
{
ndata=new Date()
// Получение показаний часов, минут и секунд
hours= ndata.getHours();
mins= ndata.getMinutes();
secs= ndata.getSeconds();
// Дополнение показаний нулем слева
if (hours < 10) {hours = "0" + hours }
if (mins < 10) {mins = "0" + mins }
if (secs < 10) {secs = "0" + secs }
// Суммирование всех данных для вывода
datastr =hours+":" + mins+":" +secs
// Запись данных
document.clockexam.clock.value = " "+datastr;
// Вызов функции с интервалом 1000 ms
setTimeout("myclock()", 1000);
}
-->
</script>
<form name="clockexam"><input type="text" size="9" name="clock"></form>
</body>
</html> | Дизайн Scriptic. |
|
|
 |
 20.05.2008 21:23 | #3 |
| | LupusNox
На форуме с 18.05.2008 Сообщений: 12 Профиль | Часы в бегущей строке поля формы.| Цитата: | <head>
<title>Часики в бегущей строке</title>
</head>
<script LANGUAGE="javascript">
var id
var position=0
var numofloop=10
function banner() {
var nor = new Date()
var minutes = nor.getMinutes()
var hours = nor.getHours()
var seconds = nor.getSeconds()
var nortime = "В мнастоящий момент "
nortime += ((hours > 12) ? hours - 12 : hours)
nortime += ((minutes < 10) ? ":0" : ":") + minutes
nortime += ((seconds < 10) ? ":0" : ":") + seconds
nortime += (hours >= 12) ? " после полудня" : " до полудня"
var msg=" А знаете сколько сейчас времени? " + nortime + " ";
var pace=10;
document.form.banner.value=msg.substring(position,position+75) ;
if (position++==msg.length) {
if (numofloop-- < 2) return;
position=0;
}
id=setTimeout ("banner()", 1000/pace);
}
</script>
<body onload="banner()">
<form name="form">
<input type="text" name="banner" size="40">
</form>
</body>
</html> | Дизайн Scriptic. |
|
|
 |
 20.05.2008 21:26 | #4 |
| | LupusNox
На форуме с 18.05.2008 Сообщений: 12 Профиль | Часы фоном. Можно менять размер, расположение и цветовую гамму часов.| Цитата: | <html>
<head>
<title>Часы фоном. Можно менять размер, расположение и цветовую гамму часов.</title>
</head>
<script language=javaScript>
<!--
function clockon() {
thistime= new Date()
var hours=thistime.getHours()
var minutes=thistime.getMinutes()
var seconds=thistime.getSeconds()
if (eval(hours) <10) {hours="0"+hours}
if (eval(minutes) < 10) {minutes="0"+minutes}
if (seconds < 10) {seconds="0"+seconds}
thistime = hours+":"+minutes+":"+seconds
if(document.all) {
bgclocknoshade.innerHTML=thistime
bgclockshade.innerHTML=thistime
}
if(document.layers) {
document.bgclockshade.document.write('<div id="bgclockshade" style="position:absolute;visibility:visible;font-family:Verdana;color:FFAAAAA;font-size:120px;top:10px;left:12px">'+thistime+'</div>')
document.bgclocknoshade.document.write('<div id="bgclocknoshade" style="position:absolute;visibility:visible;font-family:Verdana;color DDDDD;font-size:120px;top:10px;left:10px">'+thistime+'</div>')
document.close()
}
var timer=setTimeout("clockon()",200)
}
// - End of JavaScript - -->
</script>
</head>
<body onLoad="">
<div id="bgclockshade" style="position:absolute; visibility:visible; font-family:Verdana; color:#006600; font-size:36px; top:10px; left:290px"></div>
<div id="bgclocknoshade" style="position:absolute; visibility:visible;font-family:Verdana; color:#009900; font-size:36px; top:9px; left:287px"></div>
<div id="mainbody" style="position:absolute; visibility:visible"></div>
</body>
</html> | Дизайн Scriptic. |
|
|
 |
 20.05.2008 21:27 | #5 |
| | LupusNox
На форуме с 18.05.2008 Сообщений: 12 Профиль | Скрипт выводит время до события (праздника).| Цитата: | <html>
<head>
<title>Скрипт выводит время до события (праздника).</title>
<script language="JavaScript"><!--
function cntdown1(){
today = new Date()
nextEVENT = new Date("January 1, 3000")
msPerDay = 24 * 60 * 60 * 1000 ;daysLeft = (nextEVENT.getTime() - today.getTime()) / msPerDay;daysLeft = Math.round(daysLeft);document.write("До 3000 года осталось <FONT COLOR=\"#ffff00\">" + daysLeft + " дней(я)</FONT><br>") ;
minutesLeft=(nextEVENT.getTime() - today.getTime()) / 60000;
minutesLeft = Math.round(minutesLeft);
document.write("Или точнее <FONT COLOR=\"#ffff00\">" + minutesLeft + " минут(ы)</FONT>") ;
}//--></script>
</head>
<body>
<script>cntdown1()</script>
</body>
</html> | Дизайн Scriptic. |
|
|
 |
 31.07.2008 17:49 | #6 |
| | Shika
На форуме с 31.07.2008 Сообщений: 1 Профиль | А у меня почемут не все часики идут....=( |
|
|
 |
 13.08.2008 01:46 | #7 |
| | _TONY_
На форуме с 13.05.2008 Сообщений: 5 Профиль | А где календарики??? |
|
|