This is a question to all Mozilla users/developers.
I while ago I've created such a function:
function highlight(elem, overColor, outColor) {
obj = document.getElementById(elem).style;
obj.backgroundColor = (obj.backgroundColor == overColor) ? outColor : overColor;
}
It is called like this:
<p id="one" onmouseover="highlight('one', '#eeccff', 'white')" onmouseout="highlight('one', '#eeccff', 'white')">
It works excellent in Opera 6 and IE5, but by some unclear reason doesn't work in Mozilla 1.1: color changes only once to 'highlighted' state, and doesn't change back to 'normal' when you move mouse out of an element.
I tested this also in Netscape 6.2 to make sure that it isn't some small bug in the latest build of Gecko engine. It really isn't - I've seen the same behavior there as well.
It dosn't matter what element do you apply this to: I tested <p>, <div> as well as table elements. The behaviour is the same in all cases: Opera 6 and IE5 are OK, but Mozilla fails.
Unlike this, such a thing:
function showHide(element) {
obj = document.getElementById(element).style;
obj.visibility = (obj.visibility == "visible"
? "hidden" : "visible";
}
works well in all 3 browsers. So what happens with the same ternary operator, but applied to different style property??
Please don't suggest me to change it to if...else, or split it into 2 different functions. The whole point was to make one function, short and simple using ternary operator.
I treat this situation as a rather serious Mozilla's problem. To tell the truth, this had changed my faith in this browser as being "the most ..." as it is advertised, bacause such a basic language structure shouldn't cause any problems.
So what do you say, Mozilla fans?
Fight for your favourite browser!
P.S. If no solution or explanation will be found, please post this to BugZilla on my behalf.
I while ago I've created such a function:
function highlight(elem, overColor, outColor) {
obj = document.getElementById(elem).style;
obj.backgroundColor = (obj.backgroundColor == overColor) ? outColor : overColor;
}
It is called like this:
<p id="one" onmouseover="highlight('one', '#eeccff', 'white')" onmouseout="highlight('one', '#eeccff', 'white')">
It works excellent in Opera 6 and IE5, but by some unclear reason doesn't work in Mozilla 1.1: color changes only once to 'highlighted' state, and doesn't change back to 'normal' when you move mouse out of an element.
I tested this also in Netscape 6.2 to make sure that it isn't some small bug in the latest build of Gecko engine. It really isn't - I've seen the same behavior there as well.
It dosn't matter what element do you apply this to: I tested <p>, <div> as well as table elements. The behaviour is the same in all cases: Opera 6 and IE5 are OK, but Mozilla fails.
Unlike this, such a thing:
function showHide(element) {
obj = document.getElementById(element).style;
obj.visibility = (obj.visibility == "visible"
}
works well in all 3 browsers. So what happens with the same ternary operator, but applied to different style property??
Please don't suggest me to change it to if...else, or split it into 2 different functions. The whole point was to make one function, short and simple using ternary operator.
I treat this situation as a rather serious Mozilla's problem. To tell the truth, this had changed my faith in this browser as being "the most ..." as it is advertised, bacause such a basic language structure shouldn't cause any problems.
So what do you say, Mozilla fans?
Fight for your favourite browser!
P.S. If no solution or explanation will be found, please post this to BugZilla on my behalf.