User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 391,615 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,620 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 4550 | Replies: 4
Reply
Join Date: Jun 2005
Posts: 4
Reputation: Krofh is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Krofh Krofh is offline Offline
Newbie Poster

Help Javascript/CSS Problem: Display is not properly hiding items (style.display="none")

  #1  
Jul 30th, 2006
Hello,
The title pretty much describes the problem I'm having. Right now, I've got a <table> with two <tbody>s in it; the first one is visible (display:inline) and the second one is invisible (display:none). The first one contains a button, the second one several form fields. Pressing the button hides the first tbody (style.display="none") and shows the second (style.display="inline"). Filling out the form and pressing a "Save" button at the end hides the second tbody again and shows the first tbody. The trouble is, there is still some blank space left there, which accumulates each time the buttons are pressed, leaving quite a large gap. Note: this is happening in Firefox (using 1.5), it seems to be fine in IE 6. Any help would be appreciated Example script here: http://www.krofh.net/example.html (taken out of context of the original page it was in, but it still demonstrates the problem) Thanks,
- Jesse
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2005
Location: Wellington, New Zealand
Posts: 182
Reputation: alpha_foobar is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 3
alpha_foobar's Avatar
alpha_foobar alpha_foobar is offline Offline
Junior Poster

Re: Javascript/CSS Problem: Display is not properly hiding items (style.display="none")

  #2  
Jul 30th, 2006
I think you have forgotten to close the second tbody - this could cause your issue.
Reply With Quote  
Join Date: May 2005
Location: Wellington, New Zealand
Posts: 182
Reputation: alpha_foobar is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 3
alpha_foobar's Avatar
alpha_foobar alpha_foobar is offline Offline
Junior Poster

Re: Javascript/CSS Problem: Display is not properly hiding items (style.display="none")

  #3  
Jul 30th, 2006
Sorry, the second tbody is the rest of the table.. my bad.

This all seems over complicated, why don't you use one table... or better, no tables? Then just show and hide div elements?
Reply With Quote  
Join Date: Jun 2005
Posts: 4
Reputation: Krofh is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Krofh Krofh is offline Offline
Newbie Poster

Re: Javascript/CSS Problem: Display is not properly hiding items (style.display="none")

  #4  
Jul 30th, 2006
Why not DIV elements? It's because I like lining my forms up in the table with left-align for the name and right-align for the fields. If you could tell me a way to do that with DIVs, that'd be great.
Also, I just made a few changes, because there were a few tags that had gotten lost when I pulled that bit of code out to work just on that... but it still hasn't fixed it. I ran it through the w3 validator, and there aren't any tags missing or anything wrong with it, so... not sure what's causing the trouble.
Reply With Quote  
Join Date: Jun 2005
Posts: 4
Reputation: Krofh is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Krofh Krofh is offline Offline
Newbie Poster

Re: Javascript/CSS Problem: Display is not properly hiding items (style.display="none")

  #5  
Jul 30th, 2006
Arrr! I have solved the problem, using your suggestion of DIVs. I'm still using lots of tables; part of the excessive table pieces is me trying to work with the typical vBulletin system layout, I'm writing a vB hack... but also, when it parses the templates, it has a tendency to add things like extra <tbody>s in there that I don't really need. Anywho, it's working now, thanks for the suggestion.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 12:21 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC