к оглавлению
Приветствие в зависимости от времени суток
Пример:
<script language="JavaScript"> <!-- hide script from old browsers function process(){} today = new Date() if(today.getMinutes() < 10) { pad = "0"} else pad = ""; if((today.getHours() < 12) && (today.getHours() >= 6)) { document.write("<center><FONT SIZE=4 color=white>Доброе утро</FONT></center>")} if((today.getHours() >= 12) && (today.getHours() < 18)) { document.write("<center><FONT SIZE=4 color=white>Добрый день</FONT></center>")} if((today.getHours() >= 18) && (today.getHours() <= 23)) { document.write("<center><FONT SIZE=4 color=white>Добрый вечер</FONT></center>")} if((today.getHours() >= 0) && (today.getHours() < 4)) { document.write("<center><FONT SIZE=4 color=white>Доброй ночи</FONT></center>")} if((today.getHours() >= 4) && (today.getHours() <= 6)) { document.write("<center><FONT SIZE=4 color=white>Кто ходит в гости по утрам...</FONT></center>")} document.write("<center><FONT SIZE=3 color=white>Время: ",today.getHours(),":",pad,today.getMinutes()) document.write(" Число: ",today.getMonth()+1,"/",today.getDate(),"/",today.getYear(),"<br></font></center>"); // end hiding contents --> </script>
Copyright WebeInfo © 2005-2006
Сайт создан в системе
uCoz