Closed Thread Icon

Topic awaiting preservation: NS7 (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8559" title="Pages that link to Topic awaiting preservation: NS7 (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: NS7 <span class="small">(Page 1 of 1)</span>\

 
Boudga
Maniac (V) Mad Scientist

From: Jacks raging bile duct....
Insane since: Mar 2000

posted posted 03-04-2003 19:39

In the following page I'm utilizing visibility: visible/hidden. This script doesn't work correctly in Netscape 7. Can anyone tell me where I can find documentation on work arounds for this visibility problem?



[This message has been edited by Boudga (edited 03-04-2003).]

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 03-04-2003 20:07

Ug.

That's some darn ugly code. Regardless, it should still work in Netscape 7, so I don't know why it doesn't. Does it work in Mozilla?

Coding tips:
1. learn "else if"
2. remove all three occurances of the eval function, none of them are necessary
3. if support for NN4 is really that important to you, use "show" and "hide" instead of "show" and "hidden".

kuckus
Bipolar (III) Inmate

From: Berlin (almost)
Insane since: Dec 2001

posted posted 03-04-2003 20:56

Works fine for me in Mozilla 1.3(b). Netscape 7 is based on a much less recent version of Mozilla though (1.0.something I think), so it could be that it interprets your code in a way it shouldn't ... but following Slime's tips might help there as well.

Boudga
Maniac (V) Mad Scientist

From: Jacks raging bile duct....
Insane since: Mar 2000

posted posted 03-04-2003 21:14

Slime can you point me to any URLs that show a more elegant means of achieving what I'm trying to achieve

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 03-04-2003 21:27

function toggleVisibility(id, vis) {
if (document.getElementById) {
document.getElementById(id).style.visibility = vis
} elseif (document.layers) {
document.layers[id].visibility = (vis == 'visible') ? 'show':'hide';
} elseif(document.all) {
document.all.id.style.visiblity = vis;
}
}


now just call it with
toggleVisiblity('mail', 'visible');
or toggleVisiblity('mail','hidden');

I think that should work



.:[ Never resist a perfect moment ]:.

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 03-04-2003 21:47

Bit's code is excellent; just change the line

document.all.id.style.visiblity = vis;

to

document.all[id]style.visiblity = vis;

since you don't actually want (the property of document.all named "id"), you want (the property of document.all named (whatever the sting-value of "id" is)).

« BackwardsOnwards »

Show Forum Drop Down Menu