Помощник
|
Скрипт часов UTC |
Гость_0_*
Гость_0_* |
Сообщение
#1
|
||
|
|
||
|
|||
ZiTosS |
14.4.2009, 11:35;
Ответить: ZiTosS
Сообщение
#2
|
|
|
Вот переделал старый вариант, у меня тут лежал. Отлично работает в IE и FF.
<html> <head> <title>Время в разных городах.</title> <style type="text/css"> .timestyle { position:absolute; font-size:8pt; color:#ffff00; background-color:#006600; } </style> <script type="text/javaScript"> var worldtime = new Array() worldtime[0]="London,0" worldtime[1]="Berlin,1" worldtime[2]="Paris,1" worldtime[3]="Johannesburg,2" worldtime[4]="Kairo,2" worldtime[5]="Baghdad,3" worldtime[6]="Moscow,4" worldtime[7]="Beijing,8" worldtime[8]="Hong Kong,8" worldtime[9]="Perth,8" worldtime[10]="Tokyo,9" worldtime[11]="Sydney,11" worldtime[12]="Azores,-1" worldtime[13]="Rio de Janheiro,-2" worldtime[14]="Buenos Aires,-3" worldtime[15]="Lima,-5" worldtime[16]="New York,-5" worldtime[17]="Chicago,-6" worldtime[18]="Mexico City,-6" worldtime[19]="Denver,-7" worldtime[20]="San Francisco,-8" worldtime[20]="Honolulu,-10" var hours var shifthours var minutes var seconds var localhours var pause=2000 var thisplace var thisline="" var showmenu=1 function showtime() { for (i=0; i<=worldtime.length-1;i++) { thisplace=worldtime[i].split(",") thistime= new Date() hours=thistime.getUTCHours() hours=eval(hours) shifthours=eval(thisplace[1]) localhours=eval(shifthours+hours) if (localhours <0) {localhours=24+localhours} if (localhours >=24) {localhours=localhours-24} minutes=thistime.getUTCMinutes() seconds=thistime.getUTCSeconds() if (thisplace[0]=='Delhi') { minutes=eval(minutes+30) if (minutes>=60) { minutes=eval(minutes-60) localhours=eval(localhours+1) } } if (eval(minutes) < 10) {minutes="0"+minutes} if (eval(seconds) < 10) {seconds="0"+seconds} if (eval(localhours) < 10) {localhours="0"+localhours} thisline += localhours + ":" + minutes + ":"+seconds + " " + thisplace[0] + "<br>"; } document.getElementById('timediv').innerHTML = thisline; thisline=""; var timer=setTimeout("showtime()",1000); } function dblclick() { if (showmenu==1) { document.getElementById('timediv').style.visibility = "visible"; document.getElementById('timediv').style.left = x; document.getElementById('timediv').style.top = y; showtime() } if (showmenu!=1) { document.getElementById('timediv').style.visibility = "hidden"; } showmenu=showmenu*-1 } if (document.layers) { document.captureEvents(Event.ONDBLCLICK); } document.ondblclick=dblclick; if (document.layers){ document.captureEvents(Event.MOUSEMOVE); } document.onmousemove = handlerMM; function handlerMM(e){ try { x = (document.layers) ? e.pageX : e.clientX; y = (document.layers) ? e.pageY : e.clientY; } catch(e){ x = (document.layers) ? e.pageX : event.clientX; y = (document.layers) ? e.pageY : event.clientY; } } </script> <body> <div style="width: 100%; height: 500px; background: #c6c6c6;"> <div class="timestyle" id="timediv"> </div> </div> </body> </html>
|
|
|
||
|
Похожие темы
Тема | Ответов | Автор | Просмотров | Последний ответ | |
---|---|---|---|---|---|
Скрипт поисковика видео StrongTube | 3 | 3josoft | 1561 | 14.8.2023, 14:45 автор: 3josoft |
|
Скрипт приема платежей p2p с карты на карту card2card Скрипт приема платежей p2p с карты на карту card2card |
15 | zladey1986 | 7781 | 26.3.2023, 8:54 автор: Palundra |
|
Продам скрипт перевода постов и комментариев | 4 | Tutich | 749 | 19.1.2023, 17:23 автор: Tutich |
|
Битрикс скрипт нативной установки | 3 | Nemo | 2439 | 20.11.2022, 10:09 автор: Webmaster24 |
|
Посоветуйте скрипт интернет-магазина (партнерская программа - критична!) |
9 | Aloof | 7317 | 2.12.2021, 15:03 автор: Ilonek |
Текстовая версия | Сейчас: 29.3.2024, 19:26 |