Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes HTML, CSS and JavaScript and the fly likes div hidding and displaying Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "div hidding and displaying" Watch "div hidding and displaying" New topic

div hidding and displaying

Pablo M�ller
Ranch Hand

Joined: Dec 12, 2006
Posts: 63
I have a table that has one cell inside each row. In this cell I have two divs, one has only text and the other has a text field. When the page is loaded, the only thing showing is the first one (the other is hidden with visibility:"hidden" . When it's clicked, it has to hide and show the div with the text field. When this text field looses focus has to hide and show the other one again.
I made this work on firefox like this:

On Internet Explorer doesn't work the same way (of course ), the divs hide and show, but the hidden one leaves a blank space on the screen, it doesn't "disappear" like on firefox. Is there any workaround for this?
Thanks a lot,

2B || !2B
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
use display instead of visibility"block"; // show
and"none"; //hide

Pablo M�ller
Ranch Hand

Joined: Dec 12, 2006
Posts: 63
Thanks Eric,
That worked ok on both browsers!
I agree. Here's the link:
subject: div hidding and displaying
It's not a secret anymore!