Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] folding menu


  • From: rer at datacompusa.com (Roger Roelofs)
  • Subject: [Javascript] folding menu
  • Date: Wed Feb 15 07:10:48 2006

Michael,

On Feb 15, 2006, at 7:59 AM, Michael Borchers wrote:

> i have some div areas that change their visibility by changing a  
> checkbox. unfortunately there is a lot of space inside the divs and  
> the page is quite long since several divs follow.
>
> can i also make this space dissappear when visibility is hidden?!

Yes.
---------  css  --------
.hide { display: none; }
---------  js ----------
function toggle(sElId) // overly simplistic
var el = document.getElementById(sElId);
if ( el.className == "hide" ) {
	el.className = "";
} else {
	el.className = "hide";
}

Roger
--
Roger Roelofs                          web   www.datacompusa.com
Datacomp Appraisal Services   Email rer@xxxxxxxxxxxxxxx
3215 Eaglecrest Drive, NE
Grand Rapids, MI  49525-4593