Hidden layers using CSS and JavaScript

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.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jun 29th, 2006, 17:20
New Member
Join Date: Jun 2006
Location: CA
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote

  #2 (permalink)  
Old Jun 29th, 2006, 21:17
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
Reply

Tags
hidden, layers, using, css, javascript

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 01:16.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43