Hi Everyone,
I have a simple dropdown on the top of my website pages that I use for logins and a mini control panel. To do this I have the following jquery code:
- $(document).ready(function() {
// Expand Panel
$("#open").click(function(){
$("div#panel").slideDown("slow");
});
// Collapse Panel
$("#close").click(function(){
$("div#panel").slideUp("slow");
});
// Switch buttons from open to closed labels on click
$("#toggle a").click(function () {
$("#toggle a").toggle();
});
});
I would like to make it so that if the bar is open (ie the user can see the drop down) and the user clicks outside of the dropdown div then the bar retracts to the closed position. Currently the bar only closes if you press the close button and if it is open you can't click anything on the site.
Thanks in advance for the help.