Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 16th, 2003, 02:43 AM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Mimi
Default difference between style.visibility and style.disp

:DHallo!!!

I was instructed to use style.display instead of style.visibility, what's the difference? I noticed that style.visibility was used to hide fields, can that be done with style.display? If yes, how?

Thanks!!!

Reply With Quote
  #2 (permalink)  
Old September 16th, 2003, 06:21 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

style.visiblity makes the element visible or hidden, it is still rendered and takes up space on the page even if you can't see it. If you set style.display to "none" the markup is not processed and does not take up space on the page.

--

Joe
Reply With Quote
  #3 (permalink)  
Old September 17th, 2003, 04:45 AM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Mimi
Default

Thanks Joe!

 I dunno what's wrong with my code! When I used style.display instead of style.visibility the hidden parts don't show! What could be the problem???
Help please! Thanks

Reply With Quote
  #4 (permalink)  
Old September 17th, 2003, 04:50 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Why should the hidden parts show? What is your exact code? If you set visibility to "hidden" then setting the style.display to "block" will not unhide the element.

--

Joe
Reply With Quote
  #5 (permalink)  
Old September 17th, 2003, 06:02 AM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Mimi
Default

This was my original code:
if (f.Over.checked == true) {
        Over.style.visibility = 'visible';

This is my new code
if (f.Over.checked == true) {
        Over.style.display = "block";


Whats wrong with my new code?
If you want to see my whole code just tell me.

Thanks Joe!

Reply With Quote
  #6 (permalink)  
Old September 17th, 2003, 07:23 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Not sure what you wish to do. If Over is a checkbox and is checked then do you want to set it to dispaly? If so then:
Code:
Over.style.display = "inline";
or
Code:
Over.style.display = "";
should be okay. It seems a bit odd though, if the box was set to display:none then how could it be checked?

--

Joe
Reply With Quote
  #7 (permalink)  
Old September 17th, 2003, 11:50 PM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Mimi
Default

hey thanks Joe! Used Over.style.display = "";
 and it worked :)

Super thanks!

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView Style.! vinod ASP.NET 2.0 Professional 1 January 21st, 2008 06:05 AM
Style wiegel BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 February 27th, 2007 09:28 PM
Help with Style Builder jasonntp ASP.NET 2.0 Basics 1 November 11th, 2006 01:35 AM
Help with style Boomah XSLT 4 November 2nd, 2006 09:19 AM
non-selectable style? nerssi CSS Cascading Style Sheets 1 June 23rd, 2005 09:30 AM



All times are GMT -4. The time now is 09:12 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.