Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 960
  • Last Modified:

Problem making DIV tags Visible and Hidden

I'm running across a problem when trying to make Div tag visible and hidden.

Here is an example:
http://felix2000.myftp.org/test/test1.html

When you click on the names Network Advisories, Network Handoffs it toggles the corresponding div tags to hidden or back to visible it also changes the position from relative to absolute so that it will shrink down.

What you will notice those is when trying to make it visible again the area comes back but all the text and stuff in the div is still hidden.

If you check here I no longer have it reset the position of the div tag and everything works except it holds the area that the div held.
http://felix2000.myftp.org/test/test2.html

Any help figuring this one out is much appreciated.

-=[ Felix ]=-

0
Felix2000
Asked:
Felix2000
2 Solutions
 
ZylochCommented:
Hi Felix2000,

This is actually an IE only problem. Use display instead of visiblity:

function hidediv( divid )
{
    divtag = document.getElementById( divid );
    if ( divtag.style.display == 'none')
        {

            divtag.style.display = '';
        } else {
            divtag.style.display = '';
        }
}

Regards,
Zyloch
0
 
StormyWatersCommented:
use display:none and display:block instead of visibility.
And it works fine the way it is in Firefox, but is buggy (What a suprise!!) in IE.
0
 
Felix2000Author Commented:
Argh!!! I was even on the right track playing with that display, but I didn't take out the position crap.
Thanks both!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now