So the situation is like this:
I have several links, each with one hidden div that needs to be shown when the user clicks the specific link. Of course the already visible div from another link need to be hidden in the same operation. All of the divs are hidden by default.
I was thinking that the simplest way is to assign an id active to the child div of the link clicked and then show() #active, afterwards at every click on another div I would hide the #active id, assign it again to another div and then show the id. Is it possible and how would the code look like?
Yes I am a Jquery newbie. The html code looks like:
<div class="nav">
<ul>
<li><a href="#" title="show phone #(403) 454-5526">Call us</a>
<div class="navLinks"> (403) 454-5526 </div>
</li>
<li><a href="#">Visit our website</a>
<div class="navLinks"> Content Here </div>
</li>
<li><a href="#"Email us</a>
<div class="navLinks"> Content Here </div>
</li>
<li><a href="#">Send to a friend</a>
<div class="navLinks"> Content Here </div>
</li>
</ul>
</div>
How about something like that?
DEMO: http://jsfiddle.net/4ncew/1/