954,170 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Hide all DIV's On Click

Hello all:

I'm creating an image gallery that opens in hidden divs. Here's my javascript code:

If the user clicks on this link

exterior1_th.jpg
Exterior Photo One

it displays this div:

exterior1.jpg
Close Window [X]

As you can see, when the user clicks "Close Window" it will hide the div.

Here's what I'm having trouble with:

if the user clicks on another link to show another DIV without closing the previous one, I need a fuction that will hide all DIV's that might be visible.

I'm a little stumped on this one. Help :-)

RustyShock
Newbie Poster
1 post since May 2005
Reputation Points: 10
Solved Threads: 0
 

Create an array. Store the ID of the DIVs into that array when the user makes them visible.

Each time they click a link to make a div visible, iterate through the array, toggling all the other divs.

tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You