On Wed, Mar 11, 2009 at 1:26 PM, angelo.perazz...@gmail.com <
angelo.perazz...@gmail.com> wrote:

>
> In essence, this is a page with 6 links and 6 initially hidden div. By
> clicking on a link, the div appears relevant, it disappears by
> clicking on the link again thanks to fadeToggle function.  By clicking
> on a different link, the div (already opened). disappears thanks to
> fadeOut function.
> Thank you all for your help!
>

i'd give the six links a common class name (as opposed to a specific class
per link).  something like <a href="foo.html" class="toggler">
then in your code:

$(function() {
     $('.toggler').click(function() {
          $('.toggler').fadeOut('slow');
          $(this).fadeToggle();
     });
});

This way, when any link with the class "toggler" is clicked, all of the
links will fade out, and the one that triggered the click event (referenced
by $(this)) will have the fadeToggle() run on it.

That might not be perfect, but should hopefully get you started.

-- 
I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.

Reply via email to