Newsgroup: it.comp.www.html
Titolo: 2 orologi con 2 fusi orari diversi

dopo aver guardato in 
html.it
 ed in altri che danno javascript gratuiti gia'
pronti non sono ancora riuscito a trovare ne un orologio analogico, intendo
quello con le lancette, e neppure il sistema per avere un fuso orario
diverso dal primo orologio con 6 ore di meno...
riassunto: cerco 2 orologi analogici con 6 ore di differenza...
chi mi aiuta???
specifico pure che con l'html ed ancor di piu' con i javascript sono alle
prime armi!!!
Davide
--
http://utenti.tripod.it/cubapratica/index.htm
http://members.xoom.it/mildav/index.htm
ICQ 65718913

prova qui:
http://www.geocities.com/~bastita3/oradata.html
Ciao


 pronti non sono ancora riuscito a trovare ne un orologio analogico,
Dalla ML di HTML.it (un Javascript a settimana):
Tra i campi <HEAD> va inserito questo codice:
-------------------------
<script language="javascript">
var isNS=(navigator.appName=="Netscape");
var _all=(isNS)? 'outer.document.' : 'all.' ;
var _style=(isNS)? '' : '.style' ;
var cnt=new Array(), radius=6, result, now=new Date();
var ring1_X, ring2_X, ring3_X, ring4_X, ring5_X, ring6_X, ring1_Y, ring2_Y,
ring3_Y, ring4_Y, ring5_Y, ring6_Y;
var names='hrs1hrs2hrs3hrs4min1min2min3min4min5sec1sec2sec3sec4sec5sec6';
var dow="SunMonTueWedThuFriSatSun";
var months=new
Array('January','Febuary','March','April','May','June','July','August','Sept
ember','October','November','December');
var timestring=''
function init(){
cnt[0]=0;
for(i=1;i<=60;i++){
cnt[i]=cnt[i-1]+((Math.PI*2)/60);
cnt[i-1]+=Math.PI/180;
}
for(num=1;num<=6;num++){
eval('ring'+num+'_X=new Array()');
eval('ring'+num+'_Y=new Array()');
for(i=1;i<=60;i++){
result=((i-15)<0)? 60+i-15 : i-15;
eval('ring'+num+'_X['+i+']='+Math.floor((num*radius*Math.cos(cnt[result]))+5
6));
eval('ring'+num+'_Y['+i+']='+Math.floor((num*radius*Math.sin(cnt[result]))+5
5));
}
eval('ring'+num+'_Y[0]=ring'+num+'_Y[60]');
eval('ring'+num+'_X[0]=ring'+num+'_X[60]');
}
runclock();
}
function runclock(){
timestring=''
now=new Date(); now.hrs=now.getHours(); now.min=now.getMinutes();
now.sec=now.getSeconds();
if (now.hrs<10) timestring+='0'+now.hrs+':'; else timestring+=now.hrs+':'
if (now.min<10) timestring+='0'+now.min+':'; else timestring+=now.min+':'
if (now.sec<10) timestring+='0'+now.sec; else timestring+=now.sec
document.digital.digital2.value=timestring
now.hrs=(now.hrs>=12)? now.hrs-12 : now.hrs;
now.hrs=Math.floor((now.hrs*5)+(now.min/12));
for(n=0;n<names.length;n+=4){
movetick(names.substr(n,4), names.substr(n+3,1), 'now.'+names.substr(n,3) );
}
setTimeout('runclock()',1000);
}
function movetick(obj,ringnum,timestep){
if(isNS){
eval(obj+'.top=ring'+ringnum+'_Y['+timestep+']');
eval(obj+'.left=ring'+ringnum+'_X['+timestep+']');
}else{
eval(obj+'.pixelTop=ring'+ringnum+'_Y['+timestep+']');
eval(obj+'.pixelLeft=ring'+ringnum+'_X['+timestep+']');
}}
file://document.title=dow.substr(now.getDay()*3,3)+',
'+months[now.getMonth()]+'
'+now.getDate()+', '+now.getFullYear()
window.onload=init;
</script>
-------------------------
E' un codice lungo e complesso e non va modificato in nessun punto.
Nel corpo della pagina, laddove si vuole visualizzare l'orologio e'
necessario inserire questo codice:
-------------------------
<script language="javascript">
var txt='';
txt+='<table border="0" width="117" height="117" cellspacing="0"
cellpadding="0"><tr><td align="center">';
txt+=(isNS)? '<ilayer name="outer" height="117" width="117"
z-index="1"><img src="orologio.gif">' : '<div id="outer"
style="position:relative; width:117px; height:117px; z-index:1"><img
src="orologio.gif">';
txt+=(isNS)? '<layer name="hrs1" top="-3000" left="0" bgcolor="red"
width="6" height="6" z-index="19"></layer>' : '<div id="hrs1"
style="position:absolute; top:-3000px; left:-3000px; width:6px; height:6px;
background-color:red; font-size:6px; z-index:19"></div>';
txt+=(isNS)? '<layer name="hrs2" top="-3000" left="0" bgcolor="red"
width="6" height="6" z-index="18"></layer>' : '<div id="hrs2"
style="position:absolute; top:-3000px; left:-3000px; width:6px; height:6px;
background-color:red; font-size:6px; z-index:18"></div>';
txt+=(isNS)? '<layer name="hrs3" top="-3000" left="0" bgcolor="red"
width="6" height="6" z-index="17"></layer>' : '<div id="hrs3"
style="position:absolute; top:-3000px; left:-3000px; width:6px; height:6px;
background-color:red; font-size:6px; z-index:17"></div>';
txt+=(isNS)? '<layer name="hrs4" top="-3000" left="0" bgcolor="red"
width="6" height="6" z-index="16"></layer>' : '<div id="hrs4"
style="position:absolute; top:-3000px; left:-3000px; width:6px; height:6px;
background-color:red; font-size:6px; z-index:16"></div>';
txt+=(isNS)? '<layer name="min1" top="-3000" left="0" bgcolor="blue"
width="6" height="6" z-index="15"></layer>' : '<div id="min1"
style="position:absolute; top:-3000px; left:-3000px; width:6px; height:6px;
background-color:blue; font-size:6px; z-index:15"></div>';
txt+=(isNS)? '<layer name="min2" top="-3000" left="0" bgcolor="blue"
width="6" height="6" z-index="14"></layer>' : '<div id="min2"
style="position:absolute; top:-3000px; left:-3000px; width:6px; height:6px;
background-color:blue; font-size:6px; z-index:14"></div>';
txt+=(isNS)? '<layer name="min3" top="-3000" left="0" bgcolor="blue"
width="6" height="6" z-index="13"></layer>' : '<div id="min3"
style="position:absolute; top:-3000px; left:-3000px; width:6px; height:6px;
background-color:blue; font-size:6px; z-index:13"></div>';
txt+=(isNS)? '<layer name="min4" top="-3000" left="0" bgcolor="blue"
width="6" height="6" z-index="12"></layer>' : '<div id="min4"
style="position:absolute; top:-3000px; left:-3000px; width:6px; height:6px;
background-color:blue; font-size:6px; z-index:12"></div>';
txt+=(isNS)? '<layer name="min5" top="-3000" left="0" bgcolor="blue"
width="6" height="6" z-index="11"></layer>' : '<div id="min5"
style="position:absolute; top:-3000px; left:-3000px; width:6px; height:6px;
background-color:blue; font-size:6px; z-index:11"></div>';
txt+=(isNS)? '<layer name="sec1" top="-3000" left="0" bgcolor="black"
width="6" height="6" z-index="10"></layer>' : '<div id="sec1"
style="position:absolute; top:-3000px; left:-3000px; width:6px; height:6px;
background-color:black; font-size:6px; z-index:10"></div>';
txt+=(isNS)? '<layer name="sec2" top="-3000" left="0" bgcolor="black"
width="6" height="6" z-index="9"></layer>' : '<div id="sec2"
style="position:absolute; top:-3000px; left:-3000px; width:6px; height:6px;
background-color:black; font-size:6px; z-index:9"></div>';
txt+=(isNS)? '<layer name="sec3" top="-3000" left="0" bgcolor="black"
width="6" height="6" z-index="8"></layer>' : '<div id="sec3"
style="position:absolute; top:-3000px; left:-3000px; width:6px; height:6px;
background-color:black; font-size:6px; z-index:8"></div>';
txt+=(isNS)? '<layer name="sec4" top="-3000" left="0" bgcolor="black"
width="6" height="6" z-index="7"></layer>' : '<div id="sec4"
style="position:absolute; top:-3000px; left:-3000px; width:6px; height:6px;
background-color:black; font-size:6px; z-index:7"></div>';
txt+=(isNS)? '<layer name="sec5" top="-3000" left="0" bgcolor="black"
width="6" height="6" z-index="6"></layer>' : '<div id="sec5"
style="position:absolute; top:-3000px; left:-3000px; width:6px; height:6px;
background-color:black; font-size:6px; z-index:6"></div>';
txt+=(isNS)? '<layer name="sec6" top="-3000" left="0" bgcolor="black"
width="6" height="6" z-index="5"></layer>' : '<div id="sec6"
style="position:absolute; top:-3000px; left:-3000px; width:6px; height:6px;
background-color:black; font-size:6px; z-index:5"></div>';
txt+=(isNS)? '</ilayer>' : '</div>';
txt+='</td></tr></table>';
document.write(txt);
for(n=0;n<names.length;n+=4){
eval('var '+names.substr(n,4)+'=document.'+_all+names.substr(n,4)+_style);
}
</script>
Ciao.