PDA

View Full Version : Mozilla and CSS


CRASH_OVERRIDE
08-31-2002, 12:59 AM
Does Mozilla allow you to change styles after the page has loaded? Im using the following to see if the browser is not IE, if not then it makes it invisible:
<img src="arrow.gif" id="CSSdArr" onload="if(!navigator.appName='Microsoft Internet Explorer')this.style.display='none'" />
This doesn't work in Mozilla, but removing the ! and testing it in IE it worked fine. Ive also tried this.style.visibility='hidden', and it also didnt work.

joh6nn
08-31-2002, 03:47 AM
it's because this:

if(!navigator.appName='Microsoft Internet Explorer') {

is wrong.

try this:

if (navigator.appName != 'Microsoft Internet Explorer')

also, i suggest always using braces. so, all in all, that would be

if(navigator.appName != 'Microsoft Internet Explorer') { this.style.display='none'; }