Navigation Menu
Alphabetical Listing
Site Contents

Site FAQ
About JSS
JavaScript Forum
JavaScript Tutorial
Friends of JSS

Link to Us
JavaScript Help
Contribute a script
Technology Jobs

Become a Partner

Internet.commerce

Be a Commerce Partner














Internet.com

IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

Developer Channel

FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

Great Sites

DocJavaScript.com
dhtml.com
The Freebie Directory
TheFreeSite.com

Browse Doc JS's Tips!


Hiermenus Central


Promotions

Free Announcements


Social Bookmark

General

Use JavaScript and CSS to hide/show elements on a page thus saving screen space.


Click here for information ...

Click here for more information ...

Click here for still more information ...

Notes

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: pageOrganizer.js


CSS

Paste this code into your external CSS file or in the <style> section within the HEAD section of your HTML document.


Head

Paste this code into the HEAD section of your HTML document.


Body

Paste this code into the BODY section of your HTML document


User Comments

Add a comment, suggestion, or correction
[For questions about usage, consult the Notes tab above or visit the JavaScript forum. Do not include more than two (2) lines of code in your comments. If you have suggestions or corrections, you can submit them to us.]

    
   
       
[optional]
 
[optional]

   

Comments feed Comment Feed RSS 2.0

1. From: Bj Fulmer
reference external js file
12/10/2007 01:14:15

I love this script, but I can not get it to work an external file. I created the file and saved it as "pageOrganizer.js" and in the file I have var subs_array = new Array("sub1","sub2","sub3");// Put the id's of your hidden divs in this array

function displaySubs(the_sub){
if (document.getElementById(the_sub).style.display==""){
document.getElementById(the_sub).style.display = "none";return
}
for (i=0;i<subs_array.length;i++){
var my_sub = document.getElementById(subs_array[i]);
my_sub.style.display = "none";
}
document.getElementById(the_sub).style.display = "";
}
but it always errors out. To test the code I pasted it into my html and it works. Checked my path and name of the file and it doesn't work. I even checked viewed the source of this page a found that the js was also pasted into the html and did not refer to and external js file?

Any idea's?

3. From: GL
external js file
10/31/2008 12:14:54

Just remove (my_sub.style.display = "none";) from the external js file

2. From: Lee Underwood (Admin)
01/29/2008 11:40:40

Do you have the correct path to the external file? If so, due to the limitations of these comments, you will need to submit your question to the JavaScript Forum for further help.


Do you write JavaScripts?
If you do, why not submit them to us?
We'll give you credit and a link back to your Web site.