I figured that out, just needed to put this: $(".divmenu-dados").hide();
in here $(element).click(function(){ $(".divmenu-dados").hide(); $('#' + divDados).show(); return false; }); On 14 Jun, 19:30, Glazz <brunofgas...@live.com.pt> wrote: > Hi, its working almost like i want, know it the divs stay's opened if > i open another one, i tryed using find("yourDivClass:visible").hide(); > without success. > > Here's a screenshot of what is happening:http://i40.tinypic.com/14916wg.png > > The javascript that i edited: > /** > * > **/ > $(element).click(function(){ $(this).next().show(); return > false; }); > //$(document.body).click(function(){ $('#' + > divDados).hide(); }); > $('body').click(function(event){ > if(!$(event.target).is(".divmenu-dados *")) > { > $('#' + divDados).hide(); > } > }); > /** end **/ > > My HTML: > <a class="divmenu" id="teste">Euro (€)</a> > <div class="divmenu-dados" id="teste-dados"> > <ul> > <li><a name="usd" href="index.php?currency=usd">US > Dollars ($)</a></li> > <li><a name="eur" href="index.php? > currency=eur">Euro (€)</a></li> > <li><a name="gbp" href="index.php?currency=gbp">GB > Pound (£)</a></li> > </ul> > </div> > > | > > <a class="divmenu" id="currency"><span class="en">English</ > span></a> > <div class="divmenu-dados" id="currency-dados"> > <ul> > <li><a name="usd" href="index.php? > currency=usd"><span class="en">English</span></a></li> > <li><a name="eur" href="index.php? > currency=eur"><span class="pt">Português</span></a></li> > </ul> > </div> > > The css have the "display: none;" you have mentioned before