PDA

View Full Version : netscape troubles!


Crash1hd
03-11-2003, 01:14 PM
I am having trouble with the following script for some reason its not seeing the preload in netscape 4.7 works fine in IE, Opera,Netscape 6+ and mozilla but not netscape 4.7 what can I be doing wrong!

function layerSetup() {
//this has to be in this order? dont know why other wise doesnt work!

DivTitle = new layerObject('DTitle', available_width/2-180, available_height*0);
DivIcntr = new layerObject('DIcntr', available_width/2-50, available_height/2-50);
DivMenu = new layerObject('DMenu', available_width/2-400, avhn);
}

function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}
function changeImages() {
if (document.images && (preloadFlag == true)) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
}
}
}

var preloadFlag = false;
function preloadImages() {
if (document.images) {
LED_1_Bar_1_down = newImage("Images/LED-1-Bar-1_down.gif");
LED_2_Bar_2_down = newImage("Images/LED-2-Bar-2_down.gif");
LED_3_Bar_3_down = newImage("Images/LED-3-Bar-3_down.gif");
LED_4_Bar_4_down = newImage("Images/LED-4-Bar-4_down.gif");
LED_5_Bar_5_down = newImage("Images/LED-5-Bar-5_down.gif");
LED_6_Bar_6_down = newImage("Images/LED-6-Bar-6_down.gif");

Bar_1_down = newImage("Images/Bar-1-down.gif");
Bar_2_down = newImage("Images/Bar-2-down.gif");
Bar_3_down = newImage("Images/Bar-3-down.gif");
Bar_4_down = newImage("Images/Bar-4-down.gif");
Bar_5_down = newImage("Images/Bar-5-down.gif");
Bar_6_down = newImage("Images/Bar-6-down.gif");

Screen_Bar_1_over = newImage("Images/Screen-Bar-1_over.gif");
Screen_Bar_4_over = newImage("Images/Screen-Bar-4_over.gif");
Screen_Bar_5_over = newImage("Images/Screen-Bar-5_over.gif");
Screen_Bar_6_over = newImage("Images/Screen-Bar-6_over.gif");

preloadFlag = true;
}
}
function load(){
if(ns||w3) {
available_width=innerWidth;
available_height=innerHeight;
avwn=available_width-114;
avhn=available_height-114;
preloadImages();
layerSetup();
}
if(ie) {
available_width=document.body.clientWidth;
available_height=document.body.clientHeight;
avwn=available_width-100;
avhn=available_height-110;
layerSetup();
preloadImages();
}
}
// -->
</Script>
</head>
<body onLoad="load();" background="Images/Star.jpg">

I am pretty sure it is something to do with the preload but not sure how!

THis is the error I get

JavaScript Error: http://www.site.com/page.htm,
line 47:

document[changeImages.arguments[i]] has no properties.

Borgtex
03-11-2003, 02:57 PM
Post a Javascript - Wrong forum.
Read the descriptions before posting your questions

Crash1hd
03-11-2003, 09:05 PM
This is a javascript at the top half what forum should I be posting this in?

cheesebagpipe
03-11-2003, 09:09 PM
You've got some kind of layers API running there, but without seeing it there's no way to know what those calls do. Any time a program like this runs afoul of NS4, it almost always has to do with images within layers, which requires additional referencing in that browser:

document.layer_id.document['image_name']

Can't say much more based on what you've posted....

Crash1hd
03-12-2003, 08:29 AM
I moved this to the dom section at

http://www.codingforums.com/showthread.php?s=&threadid=16169