views:

63

answers:

1

I just installed a slideDown panel from the "FAST QUOTE" button on the top of the page:

link text

Is it possible to make the panel slideUp when the user clicks anywhere outside of the slideDown panel? Below the Panel?

+2  A: 

It seems you are using jQuery (Saw from jQuerify (Firebug)). So you need to trigger the close button click when you click in the outside area.

Assuming the slide events are on .closeQ, specify your outsidearea and bind the click event to trigger the close button.

$("outsidearea").click(function(){ $(".closeQ").trigger("click"); });

Answering your comment:

On your slide down/up method add this code (at the first line (close first, open after))

$(".btn-slide.closeQ, .btn-slide2.closeQ").trigger("click");

It will find if the panel is open, and if it is opened it will trigger the event to close.

BrunoLM
Thank you so much! It works. I have a question. I had made two separate drop down panels. FAST QUOTE | CLIENT LOGIN.. Is it possible to to trigger one panel open at a time. If I click on one trigger, can it close the current and open the one triggered?Does that make sense?
Erik
I've edited the answer adding a solution to your comment.
BrunoLM