A
Andy Fish
Hi,
I have a section of a web page that I want to be able to make appear and
disappear with javascript, with the things below it moving up and down as
appropriate. I'm not using absolute positioning or anthing fancy. I put the
aforementioned section in a div:
<div id="foo">
... optional stuff in here
</div>
when I want to hide it, I do this:
document.getElementById("foo").style.display="none";
and to show it again I do this:
document.getElementById("foo").style.display="inline";
This works fine in IE6 and Opera, but I have a problem with NN7. When the
page comes up it's visible. the first time I hide it, it works fine, then I
show it again and it works, the second time I try to hide it, nothing
happens - the display style gets set to 'none' but the div is still visible
on the page.
if the div contains only text (no tags at all), it works OK every time.
Can anybody throw any light on this or suggest possible workarounds?
Many thanks
Andy
I have a section of a web page that I want to be able to make appear and
disappear with javascript, with the things below it moving up and down as
appropriate. I'm not using absolute positioning or anthing fancy. I put the
aforementioned section in a div:
<div id="foo">
... optional stuff in here
</div>
when I want to hide it, I do this:
document.getElementById("foo").style.display="none";
and to show it again I do this:
document.getElementById("foo").style.display="inline";
This works fine in IE6 and Opera, but I have a problem with NN7. When the
page comes up it's visible. the first time I hide it, it works fine, then I
show it again and it works, the second time I try to hide it, nothing
happens - the display style gets set to 'none' but the div is still visible
on the page.
if the div contains only text (no tags at all), it works OK every time.
Can anybody throw any light on this or suggest possible workarounds?
Many thanks
Andy