• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Javascript : Why does this only work in ie and not mozilla or opera??

Czar

Lifer
function show(ln,option) {
var layer = document.getElementById(ln);
layer.style.visibility = option;
}

simple stuff that just changes the layer visibility on or off as in
show("layer1","visibile")
and this makes layer1 visible
and then hidden when its hidden

It works in ie and only in mozilla and opera when I change it to be like this

function show(ln,option) {
var layer = document.getElementById("layer1");
layer.style.visibility = option;
}

which is strange and stupid because then the point of this is gone
 
BTW, I could be breaking the standards here, but did you try:

ln.style.visibility = option;

?

Call it directly.
 
that doesnt work either 🙁

I would think IE is following it better, I mean whats the point of varibles if you cant do this
var stuff = 'layer1';
and then using the varible works the same as writing it in
 
for IE browsers, visibility = visible or hidden
for Mozilla based browsers, visibility = show or hide

although later versions of Mozilla will support visibility = visible or hidden, it's best to use show and hide instead.

 
I think that it's better to follow the standard.

Linkie

Many people who use Mozilla probably will/know how to download a newer version any ways.
 


<< BTW, what is "visibile"? 😉

Does that solve your problem? LOL 😀
>>


hehe no that was just a typo there 😛

what anoys me the most is that the built in layerhideshow in dreamweaver works and I have no idea how that works because its so darn complex
 


<< for IE browsers, visibility = visible or hidden
for Mozilla based browsers, visibility = show or hide

although later versions of Mozilla will support visibility = visible or hidden, it's best to use show and hide instead.
>>


interesting but I'm using the newest version of mozilla and opera and still nothing
 
can we see your HTML portion for the layers? Netscape/Mozilla doesn't like you naming your layers using the "name" tag, use "id" tag instead.
 


<< can we see your HTML portion for the layers? Netscape/Mozilla doesn't like you naming your layers using the "name" tag, use "id" tag instead. >>


I'm using id tags

its nothing more than just

<div id="layer1" style="background-color:red">fark</div>
 
Back
Top