Solved

Problem making DIV tags Visible and Hidden

Posted on 2004-09-25
3
954 Views
Last Modified: 2012-06-21
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
Comment
Question by:Felix2000
3 Comments
 
LVL 36

Assisted Solution

by:Zyloch
Zyloch earned 75 total points
ID: 12152457
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
 
LVL 13

Accepted Solution

by:
StormyWaters earned 25 total points
ID: 12152459
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
 
LVL 3

Author Comment

by:Felix2000
ID: 12152471
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question