js AnalogUhr im Board Fehlerhaft
Verfasst: 27.03.2011 21:30
N´Abend,...
ich habe ein altes Board wieder aus der Versenkung geholt und von 3.0.0 auf 3.0.8 upgedatet sowie mit einigen Dingen ausgestattet.
Ich habe eine Analoguhr eingebunden:
Das Script der Uhr selbst sieht wie folgt aus:
Der Bereich if (o2 == 0 && o3 == 0 && o4 == 0){document.suhr.play();} ist eigentlich nur von 0-3Uhr aber zu Testzwecken habe ich es auf 24Stunden ausgeweitet.
Zu jeder vollen Stunde soll Sie eine mp3 abspielen. Und zwischen 0-3Uhr 1 Forenbereich Sichtbar machen. Was ich per Abfrage in der functions_display.php geregelt habe...
Aber die Uhr hat leider eine Macke die ich nicht verstehe... Im IE 9 funktioniert es Einwandfrei inkl. mp3 abspielen. Im FF4 bleibt der Zeiger 1sek vor der vollen Stunde stehen und nichts tut sich mehr bis man die Seite neu ladet. Im Chrome das gleiche Spiel mit der Ausnahme das bei jedem neuladen der Seite die mp3 sich abspielt
Ich habe nun schon einige Änderungen an meinem Uraltscript versucht, aber es will nicht so wie ich das gerne hätte. Hat jemand eine Ahnung was ich hier falsch mache oder übersehe oder beides?
Das Board findet man hier http://www.d-ani.de/aav/index.php
ich habe ein altes Board wieder aus der Versenkung geholt und von 3.0.0 auf 3.0.8 upgedatet sowie mit einigen Dingen ausgestattet.
Ich habe eine Analoguhr eingebunden:
Code: Alles auswählen
<div id="logodesc">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td id="sidhe_uhr" align="left"><script language="JavaScript" src="{ROOT_PATH}js/uhr.js" type="text/javascript"></script><embed src="{ROOT_PATH}js/bell.mp3" autostart="false" loop="false" hidden="true" name="suhr" MASTERSOUND></embed></td>
</tr>
</table>
</div>
Code: Alles auswählen
// JavaScript Document
// Farbeinstellungen
su_fCol='#E153FF';//Farbe Ziffernblatt
su_sCol='#6B6B6B';//Farbe Sekunden
su_mCol='#E153FF';//Farbe Minuten
su_hCol='#FFFFFF';//Farbe Stunden
su_ClockHeight=56;
su_ClockWidth=56;
su_date=new Date();
su_day=su_date.getDate();
su_year=su_date.getYear();
if (su_year < 2100) su_year=su_year+2000;
su_H='...';
su_H=su_H.split('');
su_M='....';
su_M=su_M.split('');
su_S='.....';
su_S=su_S.split('');
su_Face='._._III_._<a href="javascript:document.suhr.play()">.</a>_VI_._._IX_._._XII';
su_font='Arial';
su_size=1;
su_speed=0.6;
ie=(document.getElementById);
su_Face=su_Face.split('_');
su_n=su_Face.length;
su_a=su_size*10;
su_ymouse=0;
su_xmouse=0;
su_scrll=0;
su_props="<font face="+su_font+" size="+su_size+" color="+su_fCol+"><B>";
su_Split=360/su_n;
su_HandHeight=su_ClockHeight/4.5
su_HandWidth=su_ClockWidth/4.5
su_HandY=-7;
su_HandX=-2.5;
su_scrll=0;
su_step=0.06;
su_currStep=0;
su_y=new Array();
su_x=new Array();
su_Y=new Array();
su_X=new Array();
for (i=0; i < su_n; i++){su_y[i]=0;su_x[i]=0;su_Y[i]=0;su_X[i]=0;}
if (ie){
document.write('<div id="Of" style="position:relative;top:'+su_ClockHeight+'px;left:'+su_ClockWidth+'px;"><div style="position:relative">');
for (i=0; i < su_n; i++)
document.write('<div id="ieFace'+i+'" style="position:absolute;top:0px;left:0;height:'+su_a+';width:'+su_a+';text-align:center">'+su_props+su_Face[i]+'</B></font></div>');
document.write('</div></div>');
document.write('<div id="Oh" style="position:relative;top:'+su_ClockHeight+'px;left:'+su_ClockWidth+'px;"><div style="position:relative">');
for (i=0; i < su_H.length; i++)
document.write('<div id="ieHours'+i+'" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+su_hCol+';text-align:center;font-weight:bold">'+su_H[i]+'</div>');
document.write('</div></div>');
document.write('<div id="Om" style="position:relative;top:'+su_ClockHeight+'px;left:'+su_ClockWidth+'px;"><div style="position:relative">');
for (i=0; i < su_M.length; i++)
document.write('<div id="ieMinutes'+i+'" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+su_mCol+';text-align:center;font-weight:bold">'+su_M[i]+'</div>');
document.write('</div></div>')
document.write('<div id="Os" style="position:relative;top:'+su_ClockHeight+'px;left:'+su_ClockWidth+'px;"><div style="position:relative">');
for (i=0; i < su_S.length; i++)
document.write('<div id="ieSeconds'+i+'" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+su_sCol+';text-align:center;font-weight:bold">'+su_S[i]+'</div>');
document.write('</div></div>')
}
function ClockAndAssign(){
time = new Date ();
secs = time.getSeconds();
sec = -1.57 + Math.PI * secs/30;
mins = time.getMinutes();
min = -1.57 + Math.PI * mins/30;
hr = time.getHours();
hrs = -1.575 + Math.PI * hr/6+Math.PI*parseInt(time.getMinutes())/360;
for (i=0; i < su_n; i++){
var F=document.getElementById('ieFace'+i).style;
caa_top = su_y[i] + su_ClockHeight*Math.sin(-1.0473 + i*su_Split*Math.PI/180)+su_scrll
caa_top = (i == 3 || i == 4 || i == 6 || i == 7)?caa_top - 5:caa_top;
caa_top = (i == 9 || i == 10)?caa_top - 2:caa_top;
caa_left = su_x[i] + su_ClockWidth*Math.cos(-1.0473 + i*su_Split*Math.PI/180)
caa_left = (i == 0 || i == 1 || i == 6 || i == 7)?caa_left + 4:caa_left;
caa_left = (i == 9 || i == 10)?caa_left + 6:caa_left;
F.top = caa_top + "px";
F.left = caa_left + "px";
}
for (i=0; i < su_H.length; i++){
var HL=document.getElementById('ieHours'+i).style;
HL.top=su_y[i]+su_HandY+(i*su_HandHeight)*Math.sin(hrs)+su_scrll+"px";
HL.left=su_x[i]+su_HandX+(i*su_HandWidth)*Math.cos(hrs)+"px";
}
for (i=0; i < su_M.length; i++){
var ML=document.getElementById('ieMinutes'+i).style;
ML.top=su_y[i]+su_HandY+(i*su_HandHeight)*Math.sin(min)+su_scrll+"px";
ML.left=su_x[i]+su_HandX+(i*su_HandWidth)*Math.cos(min)+"px";
}
for (i=0; i < su_S.length; i++){
var SL=document.getElementById('ieSeconds'+i).style;
SL.top=su_y[i]+su_HandY+(i*su_HandHeight)*Math.sin(sec)+su_scrll+"px";
SL.left=su_x[i]+su_HandX+(i*su_HandWidth)*Math.cos(sec)+"px";
}
su_currStep-=su_step;
}
function Delay(){
o1 = new Date();
o2 = o1.getHours()
o3 = o1.getMinutes()
o4 = o1.getSeconds()
if (o2 == 0 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 1 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 2 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 3 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 4 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 5 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 6 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 7 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 8 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 9 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 10 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 11 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 12 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 13 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 14 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 15 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 16 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 17 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 18 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 19 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 20 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 21 && o3 == 09 && o4 == 0){document.suhr.play();}
if (o2 == 22 && o3 == 0 && o4 == 0){document.suhr.play();}
if (o2 == 23 && o3 == 0 && o4 == 0){document.suhr.play();}
su_scrll=0;
for (i=1; i < su_n; i++){
su_y[i]=Math.round(su_Y[i]+=(su_y[i-1]-su_Y[i])*su_speed);
su_x[i]=Math.round(su_X[i]+=(su_x[i-1]-su_X[i])*su_speed);
}
ClockAndAssign();
setTimeout('Delay()',20);
}
var cDiv = document.getElementById("sidhe_uhr");
//if (ie)window.onload=Delay;
if (ie)Delay();
//document.suhr.play();
Zu jeder vollen Stunde soll Sie eine mp3 abspielen. Und zwischen 0-3Uhr 1 Forenbereich Sichtbar machen. Was ich per Abfrage in der functions_display.php geregelt habe...
Aber die Uhr hat leider eine Macke die ich nicht verstehe... Im IE 9 funktioniert es Einwandfrei inkl. mp3 abspielen. Im FF4 bleibt der Zeiger 1sek vor der vollen Stunde stehen und nichts tut sich mehr bis man die Seite neu ladet. Im Chrome das gleiche Spiel mit der Ausnahme das bei jedem neuladen der Seite die mp3 sich abspielt

Ich habe nun schon einige Änderungen an meinem Uraltscript versucht, aber es will nicht so wie ich das gerne hätte. Hat jemand eine Ahnung was ich hier falsch mache oder übersehe oder beides?
Das Board findet man hier http://www.d-ani.de/aav/index.php