Firefox JavaScript Bug(?)

There seems to be a problem with using PHP and JavaScript in Firefox, it doesn’t like running External JavaScript files or running inline JavaScript. It also has some problems with CSS Expression.


function resize()
{
var Middle = 0, Left = 0, Right = 0;

if(typeof(document.getElementById(“ContentMiddle”).offsetHeight) == ‘number’)
{
Middle = document.getElementById(“ContentMiddle”).offsetHeight;
Left = document.getElementById(“NavLeft”).offsetHeight;
Right = document.getElementById(“NavRight”).offsetHeight;
}

var Side = 0;
if(Left > Right) {
Side = Left;
} else {
Side = Right;
}

if(Middle > Side) {
document.getElementById(“NavLeft”).style.height = Middle;
document.getElementById(“NavRight”).style.height = Middle;
return Middle;
} else {
document.getElementById(“NavLeft”).style.height = Side;
document.getElementById(“NavRight”).style.height = Side;
document.getElementById(“ContentMiddle”).style.height = Side;
return Side;
}
}

Will run on Firefox along with body.onload, but won’t run when including with PHP and outputting. It could be my lack of JavaScript Skillz, but I’m doing research on fixes and what not. Surpisingly, it works fine in IE but has some Design problems in IE that I need to also fix.

Trying to call the function with the CSS expression also fails.


expression(resize());

I also could be doing this wrong and I will need to figure out a workaround or just go to using Tables within Tables, which does suck.

Fixed

It seemed that I needed to include +’px’ to the value. Once I did that, it worked perfectly on Firefox. I need to remember that later on. I still don’t know if the expression would work instead but I’m going to do a quick test to see.

Expression Test: Didn’t work.

Possibly Related Posts:


Comments are closed.