Danny Cooper
Danny Cooper

Reputation: 355

Open and Close jQuery Overlay with Same Element

I'm currently using a jQuery Tools overlay to fade in an overlay on my website.

Here's the overlay's HTML:

<div id="contact">..div content..</div>

Here's the element I'm using to open the overlay:

<span rel="#contact"></span>

Here's the jQuery I'm using for the overlay:

$(document).ready(function() 
    {$("span[rel]").overlay();
    }
);

When I click the span with rel="#contact", the div with id="contact" fades in. I want to know how to click the same span with rel="#contact" again to close the element.

Upvotes: 0

Views: 469

Answers (1)

CrayonViolent
CrayonViolent

Reputation: 32532

look at .toggle()

Upvotes: 1

Related Questions