If you assign same class to all the paragraph. so on clicking on menu you have to hide to the class element and show the particular paragraph. <li><a href="" id=home" class="changepara" >Home</a></li> <li><a href="" id="about" " class="changepara">About</a></li> <li><a href="" id=contact" " class="changepara">Contact</a></li> <li><a href="" id="gallery" " class="changepara">Gallery</a></li>
<p id="parahome" class="showhide"></p> <p id="paraabout" class="showhide"></p> : : : : : : : : <p id="paragallery" class="showhide"></p> $(document).ready(function{ flag=0; //initially all are hidden $(.changepara).click(function(){ if(flag==0) $("#para"+this.id).show("slow"); else { $(.showhide).hide("slow",function(){$("#para"+this.id).show()}); } }) On Tue, Aug 4, 2009 at 2:25 PM, StefanCandan <onlyo...@live.nl> wrote: > > What I meant was > > I have a little menu, and a paragraph for each menu item. > > Once one of the links is clicked, it should do a check if the > paragraphs of the other links are hidden, and if one is not, hide it > using the hide("slow") animation to hide it. Then if all are hidden, > use show("slow") to show the paragraph the link belongs to. > > I was thinking more of an if else statement? >