This should be the equivalent in jQuery code. $(document).bind('ready', function() { $('.Boite') .find('div').hide().end() .find('a') .bind('click', function(event) { $(this).parent().find('div').toggle(); }) });
-- Brandon Aaron On Fri, Sep 5, 2008 at 12:38 PM, israel.hayes <[EMAIL PROTECTED]>wrote: > > Hi, > > I was using MooTools before and I'm kinda new to jQuery, I'd like to > know how you would modify this to use it in jQuery, Thanks, > > - Israel > > window.addEvent('domready', function() > { > var Boites = $$('.Boite'); > > Boites.each(function(Boite) > { > var Lien = Boite.getElement('a'); > > Lien.addEvent('click', function() > { > var Boite = Lien.getParent(); > var Contenu = Boite.getElement('div'); > > if(Contenu.style.display == "none") > { > Contenu.style.display = "block"; > } > else > { > Contenu.style.display = "none"; > } > }); > > var Contenu = Boite.getElement('div'); > Contenu.style.display = 'none'; > }); > }); >