The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
Could someone tell me whether this short script will work in NS6+?
I've been trying to find out from various places but none of them says how NS6+ handles visibility and the changing of CSS attributes through the "style" part of the string.
Cheers
////
function showDiv(divToShow,hide1)
{
if (document.all)
{
document.all[hide1]. style.visibility="hidden"
document.all[divToShow]. style.visibility="visible"
}
else
if (document.getElementById())
{
document.getElementById(hide1). style.visibility="hidden"
document.getElementById(divToShow). style.visibility="visible"
}
}
> I've trawled the web in search of the answer to these questions but
> cannot find them. Anywhere. Dammit.
Hmmm. I now have answers courtesy of weird phrasing in Google.
What I've found is that NS6 supports getElementByID, sets visibility using visible/hidden and changes CSS attributes using .style.attribute=... this in theory means that the original script using getElementById should have worked in NS6, and the only reason I can think of it not working is because NS6 doesn't display background colours of the div, but gives the text within it a background colour, and because there was NO text in either div it would have given the effect of there being no change.
My solution is to add the layer-background-color property to the CSS declaration which is NS's way of adding a bg colour to the whole div and not just the text.
I have also concluded that I just don't care anymore and wish that for once corporations and businesses could agree on something instead of introducing rival products with different sodding ways of handling everything. Ergo: a single sodding browser.
I'm sure you either a) didn't read that or b) got confused by my meaningless rambling.
I don't care. I needed to rant.
*sigh*
> Turbonutter wrote:
> Nope, nothing happens.
>
> Hmmm, that means it's either the difference of show/hide or the style
> part of the string. I'll test the show/hide then.
>
> What about now?
Still no worky.
So.
Now I just need three questions answered:
1)How does NS 6 set visibility: show/hide or visible/hidden?
2)What does NS 6 support: document.all, document.getElementById or neither?
3)How do you change CSS attributes in JavaScript in NS 6: something.style.attribute= or something.attribute=?
I've trawled the web in search of the answer to these questions but cannot find them. Anywhere. Dammit.
Greenrar
Redrar
Greenrar
Redrar
Greenrar
Redrar
Greenrar
Ok, it's getting boring now...
It works with IE6, you already knew that but you didn't know that it works with ~my~ IE 6...
> Nope, nothing happens.
Hmmm, that means it's either the difference of show/hide or the style part of the string. I'll test the show/hide then.
What about now?
> Put it somewhere and I'll test it for you.
http://www.geocities.com/rbs2k2/nstest.html
If it works a green square should replace the black one.
Cheers Rob.
Could someone tell me whether this short script will work in NS6+?
I've been trying to find out from various places but none of them says how NS6+ handles visibility and the changing of CSS attributes through the "style" part of the string.
Cheers
////
function showDiv(divToShow,hide1)
{
if (document.all)
{
document.all[hide1]. style.visibility="hidden"
document.all[divToShow]. style.visibility="visible"
}
else
if (document.getElementById())
{
document.getElementById(hide1). style.visibility="hidden"
document.getElementById(divToShow). style.visibility="visible"
}
}