This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "div hidding and displaying" Watch "div hidding and displaying" New topic
Author

div hidding and displaying

Pablo M�ller
Ranch Hand

Joined: Dec 12, 2006
Posts: 63
Hi,
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,
Pablo


2B || !2B
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
use display instead of visibility

...style.display="block"; // show
and
...style.display="none"; //hide

Eric
Pablo M�ller
Ranch Hand

Joined: Dec 12, 2006
Posts: 63
Thanks Eric,
That worked ok on both browsers!
 
Consider Paul's rocket mass heater.
 
subject: div hidding and displaying
 
Similar Threads
Positioning DIVs
div layout problem
Playing IE transitions using javascript/css
showing errors in div
Creating CSS class at runtime