473,587 Members | 2,607 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

JS works on IE and not on FF3 ... Help!!

Bugsy1937
1 New Member
Hello Folks,

I wrote the following long ago and it worked for years. It Still works in IE, but can't get it to work in Firefox3.

Here's the script, hope someone can help me:

[HTML]<html>
<body>

<SCRIPT language=JavaSc ript>
dCol='black';//date colour.
fCol='black';//face colour.
sCol='black';//seconds colour.
mCol='black';//minutes colour.
hCol='black';//hours colour.
ClockHeight=60;
ClockWidth=60;
ClockFromMouseY =0;
ClockFromMouseX =150;

//Alter nothing below! Alignments will be lost!

d=new

Array("MOTORCYC LE-TOURING-ARIZONA","MOTOR CYCLE-TOURING-ARIZONA","MOTOR CYCLE-TOU

RING-ARIZONA","MOTOR CYCLE-TOURING-ARIZONA","MOTOR CYCLE-TOURING-ARIZONA","MOTOR C

YCLE-TOURING-ARIZONA","MOTOR CYCLE-TOURING-ARIZONA");
m=new

Array("JANUARY" ,"FEBRUARY","MA RCH","APRIL","M AY","JUNE","JUL Y","AUGUST","SE PTEM

BER","OCTOBER", "NOVEMBER","DEC EMBER");
date=new Date();
day=date.getDat e();
year=date.getYe ar();
if (year < 2000) year=year+1900;
TodaysDate=" "+d[date.getDay()]+" "+day+" "+m[date.getMonth()]+" "+year;
D=TodaysDate.sp lit('');
H='...';
H=H.split('');
M='....';
M=M.split('');
S='.....';
S=S.split('');
Face='1 2 3 4 5 6 7 8 9 10 11 12';
font='Arial';
size=1;
speed=0.6;
ns=(document.la yers);
ie=(document.al l);
Face=Face.split (' ');
n=Face.length;
a=size*10;
ymouse=0;
xmouse=0;
scrll=0;
props="<font face="+font+" size="+size+" color="+fCol+"> <B>";
props2="<font face="+font+" size="+size+" color="+dCol+"> <B>";
Split=360/n;
Dsplit=360/D.length;
HandHeight=Cloc kHeight/4.5
HandWidth=Clock Width/4.5
HandY=-7;
HandX=-2.5;
scrll=0;
step=0.06;
currStep=0;
y=new Array();x=new Array();Y=new Array();X=new Array();
for (i=0; i < n; i++){y[i]=0;x[i]=0;Y[i]=0;X[i]=0}
Dy=new Array();Dx=new Array();DY=new Array();DX=new Array();
for (i=0; i < D.length; i++){Dy[i]=0;Dx[i]=0;DY[i]=0;DX[i]=0}
if (ns){
for (i=0; i < D.length; i++)
document.write( '<layer name="nsDate'+i +'" top=0 left=0 height='+a+'

width='+a+'><ce nter>'+props2+D[i]+'</font></center></layer>');
for (i=0; i < n; i++)
document.write( '<layer name="nsFace'+i +'" top=0 left=0 height='+a+'

width='+a+'><ce nter>'+props+Fa ce[i]+'</font></center></layer>');
for (i=0; i < S.length; i++)
document.write( '<layer name=nsSeconds' +i+' top=0 left=0 width=15

height=15><font face=Arial size=3

color='+sCol+'> <center><b>'+ S[i]+'</b></center></font></layer>');
for (i=0; i < M.length; i++)
document.write( '<layer name=nsMinutes' +i+' top=0 left=0 width=15

height=15><font face=Arial size=3

color='+mCol+'> <center><b>'+ M[i]+'</b></center></font></layer>');
for (i=0; i < H.length; i++)
document.write( '<layer name=nsHours'+i +' top=0 left=0 width=15 height=15><font

face=Arial size=3

color='+hCol+'> <center><b>'+ H[i]+'</b></center></font></layer>');
}
if (ie){
document.write( '<div id="Od" style="position :absolute;top:0 px;left:0px"><d iv

style="position :relative">');
for (i=0; i < D.length; i++)
document.write( '<div id="ieDate"

style="position :absolute;top:0 px;left:0;heigh t:'+a+';width:' +a+';text-align:cen

ter">'+props2+ D[i]+'</B></font></div>');
document.write( '</div></div>');
document.write( '<div id="Of" style="position :absolute;top:0 px;left:0px"><d iv

style="position :relative">');
for (i=0; i < n; i++)
document.write( '<div id="ieFace"

style="position :absolute;top:0 px;left:0;heigh t:'+a+';width:' +a+';text-align:cen

ter">'+props+Fa ce[i]+'</B></font></div>');
document.write( '</div></div>');
document.write( '<div id="Oh" style="position :absolute;top:0 px;left:0px"><d iv

style="position :relative">');
for (i=0; i < H.length; i++)
document.write( '<div id="ieHours"

style="position :absolute;width :16px;height:16 px;font-family:Arial;fo nt-size:16p

x;color:'+hCol+ ';text-align:center;fo nt-weight:bold">'+ H[i]+'</div>');
document.write( '</div></div>');
document.write( '<div id="Om" style="position :absolute;top:0 px;left:0px"><d iv

style="position :relative">');
for (i=0; i < M.length; i++)
document.write( '<div id="ieMinutes"

style="position :absolute;width :16px;height:16 px;font-family:Arial;fo nt-size:16p

x;color:'+mCol+ ';text-align:center;fo nt-weight:bold">'+ M[i]+'</div>');
document.write( '</div></div>')
document.write( '<div id="Os" style="position :absolute;top:0 px;left:0px"><d iv

style="position :relative">');
for (i=0; i < S.length; i++)
document.write( '<div id="ieSeconds"

style="position :absolute;width :16px;height:16 px;font-family:Arial;fo nt-size:16p

x;color:'+sCol+ ';text-align:center;fo nt-weight:bold">'+ S[i]+'</div>');
document.write( '</div></div>')
}
(ns)?window.cap tureEvents(Even t.MOUSEMOVE):0;
function Mouse(evnt){
ymouse =

(ns)?evnt.pageY +ClockFromMouse Y-(window.pageYOf fset):event.y+C lockFromMouseY;
xmouse = (ns)?evnt.pageX +ClockFromMouse X:event.x+Clock FromMouseX;
}
(ns)?window.onM ouseMove=Mouse: document.onmous emove=Mouse;
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*parse Int(time.getMin utes())/360;
if (ie){
Od.style.top=wi ndow.document.b ody.scrollTop;
Of.style.top=wi ndow.document.b ody.scrollTop;
Oh.style.top=wi ndow.document.b ody.scrollTop;
Om.style.top=wi ndow.document.b ody.scrollTop;
Os.style.top=wi ndow.document.b ody.scrollTop;
}
for (i=0; i < n; i++){
var F=(ns)?document .layers['nsFace'+i]:ieFace[i].style;
F.top=y[i] + ClockHeight*Mat h.sin(-1.0471 + i*Split*Math.PI/180)+scrll;
F.left=x[i] + ClockWidth*Math .cos(-1.0471 + i*Split*Math.PI/180);
}
for (i=0; i < H.length; i++){
var HL=(ns)?documen t.layers['nsHours'+i]:ieHours[i].style;
HL.top=y[i]+HandY+(i*HandH eight)*Math.sin (hrs)+scrll;
HL.left=x[i]+HandX+(i*HandW idth)*Math.cos( hrs);
}
for (i=0; i < M.length; i++){
var ML=(ns)?documen t.layers['nsMinutes'+i]:ieMinutes[i].style;
ML.top=y[i]+HandY+(i*HandH eight)*Math.sin (min)+scrll;
ML.left=x[i]+HandX+(i*HandW idth)*Math.cos( min);
}
for (i=0; i < S.length; i++){
var SL=(ns)?documen t.layers['nsSeconds'+i]:ieSeconds[i].style;
SL.top=y[i]+HandY+(i*HandH eight)*Math.sin (sec)+scrll;
SL.left=x[i]+HandX+(i*HandW idth)*Math.cos( sec);
}
for (i=0; i < D.length; i++){
var DL=(ns)?documen t.layers['nsDate'+i]:ieDate[i].style;
DL.top=Dy[i] + ClockHeight*1.5 *Math.sin(currS tep+i*Dsplit*Ma th.PI/180)+scrll;
DL.left=Dx[i] + ClockWidth*1.5* Math.cos(currSt ep+i*Dsplit*Mat h.PI/180);
}
currStep-=step;
}
function Delay(){
scrll=(ns)?wind ow.pageYOffset: 0;
Dy[0]=Math.round(DY[0]+=((ymouse)-DY[0])*speed);
Dx[0]=Math.round(DX[0]+=((xmouse)-DX[0])*speed);
for (i=1; i < D.length; i++){
Dy[i]=Math.round(DY[i]+=(Dy[i-1]-DY[i])*speed);
Dx[i]=Math.round(DX[i]+=(Dx[i-1]-DX[i])*speed);
}
y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);
x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);
for (i=1; i < n; i++){
y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed);
x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed);
}
ClockAndAssign( );
setTimeout('Del ay()',20);
}
if (ns||ie)window. onload=Delay;
</SCRIPT>
</body>
</html>[/HTML]
Jul 1 '08 #1
1 1215
gits
5,390 Recognized Expert Moderator Expert
please have a look at firefox's javascript-console or use firebug to come a little bit closer to the part of code that makes problems. i assume the browser-detection is really outdated as a general hint ... but just posting a bunch of code is quite a task just to read through :) ...

kind regards
Jul 1 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
3120
by: netpurpose | last post by:
I need to extract data from this table to find the lowest prices of each product as of today. The product will be listed/grouped by the name only, discarding the product code - I use SUBSTRING(ProductName, 1, CHARINDEX('(', ProductName)-2). I can get this result, but I had to use several views (totally inefficient). I think this can be...
1
4483
by: geod | last post by:
Here's the code in question. Even as the only div in a page, mozilla e al will render this as 100%. I tried removing the background image removing padding, doing ANYTHING -- even hard-coding the height in th HTML page itself. Nothing works. Help! #right { position : absolute; font-family : Verdana, Arial, Helvetica, sans-serif;...
2
1582
by: Tim Graichen | last post by:
Could somebody please help me out with this easy one? I have a five button toggle set up. Case 1-4 work fine, so I have ommitted the code from this post. I need help with Case 5. Case five should: a) Make ClutchIDDropdown visible (works fine) b) ClutchIDdropdown should display the clutchID values from the AddAnimal table (this works...
7
3295
by: Timothy Shih | last post by:
Hi, I am trying to figure out how to use unmanaged code using P/Invoke. I wrote a simple function which takes in 2 buffers (one a byte buffer, one a char buffer) and copies the contents of the byte buffer into the character pointer. The code looks like the following: #include <stdio.h> #include <stdlib.h> #include "stdafx.h" BOOL APIENTRY...
23
3254
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application to create certain textboxes, labels, and combo boxes? Any ideas would be appreciated. Thanks
6
6992
by: comp.lang.php | last post by:
I'm involved in a rather nasty debate involving a strange issue (whereby the exasperated tell me to RTFM even after my having done so), where this is insanely possible: print_r(is_int('1')); // PRINTS NOTHING print_r(strlen((int)1)); // PRINTS '1' Now I understand that in PHP, everything scalar is a string and can
6
1877
by: JACK GUNAWAN via AccessMonster.com | last post by:
Hi, I have trouble setting up an access database on a wan because I am using dial up which charges per minute. How can I get the database to be sharred across miles with much stability and lower cost. I have read all the wan posting but still does not apply to my situation. Is using a thin server/ terminal service means that I need to...
3
1916
by: Matthew Warren | last post by:
I have the following piece of code, taken from a bigger module, that even as I was writing I _knew_ there were better ways of doing it, using a parser or somesuch at least, but learning how wasn't as fun as coding it... And yes alarm bells went off when I found myself typing eval(), and I'm sure this is an 'unusual' use of for: else: . And I...
4
1980
by: theintrepidfox | last post by:
Dear Group Excuse my ignorance but I have never come across this problem and need some advice. I have two copies of the same MS Access 2000 database. One from about 6 months ago ond one recent copy. When I open up the old copy I can see all tables in the database window. When I open up the newer copy I just see the three 'Create New Table'...
7
2288
by: William (Tamarside) | last post by:
Please, if you have the time and knowledge to help me I'd truly appreciate it! I need to build a calendar page that displays available/unavailable info from a DB and colour a cell according to that info, but somewhere I've gone completely off the rails! Basically it is a room availability page for an intranet and should simply colour a...
0
7918
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5713
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2353
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.