Hide all but one div

Hide all but one div

Hi there,

this problem has been bothering me throughout the day and I can't fix it. It seems rather simple, though.

I have some divs laid on top of each other. By clicking somewehre specific I want to hide all the divs but except for one - which is related to the point i clicked - to show up.

Here is my code so far:

The function will be called by something like this:
  1. <a href="javascript:void(0)"><img src="album_emilia.jpg" width="90px" height="125px" onclick="setAlbum('emilia')"/><p>Emilia</p></a>

  1. function setAlbum(album) {  
            $('.right_nav').each(function() {
                $(this).hide();
                //$(this).style.display='none';
            });   
            $(album).show();
            //document.getElementById(album).style.display='inline';
        }








All these divs are in the same from the right_nav-class

I guess the problem lies within line 6, where I want to select the div that should show up and is given as the argument of the function.

The commented lines are things I already tried, but didn't work either, especially $(this).style seems to be invalid.

EDIT: I guess I forgot to tell you, what exactly the problem is :D

It does hide all divs as i want, but the one i want to show again doesn't show up. It just stays hidden...


I hope you can help me
thx
Johannzz