This is a discussion on "Hidden layers using CSS and JavaScript" within the Web Page Design section. This forum, and the thread "Hidden layers using CSS and JavaScript are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Hidden layers using CSS and JavaScript
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Hidden layers using CSS and JavaScript
Hi,
I was wondering if anyone could give me some help on creating fields that are hidden and when clicked on, they appear (www.tenbricks.com is an example of what i mean). I know it relates to a javascript file - which is open source - that changes the fields property from hidden to visible, however I cant seem to get it to work. To practice i copied the format of the html on that page and the stylesheets, plus the script, and tried it out but it wasnt working. The fields were staying hidden... So if anyone knows how I should set up the fields or what I may be doing wrong, let me know. Thanks |
|
|
|
|||
|
Re: Hidden layers using CSS and JavaScript
Each of the options you see when you first land on the page is a <div>. Within each of these is another <div> that intially has its display: none set in css. Its important to make the distinction between visibility: hidden; and display: none;. If you use the visibility: hidden; attribute, the browser reserves space for the element even though you can't see it. With the display: none; not only can't you see it but no space is reserved. When you click on one of the topic areas, any div of class='content' that is currently visibible, so to speak, is hidden and the div within the topic clicked on is revealed. Notice that the headings that you click on have an onclick event, showSection('1'); for example. Append that number to the text 'content' and you have the 'id' of the div you want to show. |
![]() |
| Tags |
| hidden, layers, using, css, javascript |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Assigning a value to Hidden Type. | thanawala84 | Web Page Design | 1 | Oct 13th, 2007 08:10 |
| Please Help with hiding and displaying layers using CSS and Javascript | rosh1e | JavaScript Forum | 2 | Apr 15th, 2007 03:04 |
| hidden text | Lchad | Webforumz Cafe | 30 | Jan 5th, 2007 09:12 |
| Javascript Hidden field problem... | Rudie | JavaScript Forum | 14 | Jun 20th, 2006 22:06 |
| Hidden Fields | tomd1985 | Web Page Design | 2 | Feb 7th, 2006 20:07 |