I need to be able to click anywhere to make the
Portfolio menu close, not just click on the same tab. If you need me to explain more, just say so, and I'll do my best to help with a better explanation.
Picture related:
http://goo.gl/C4nKn
Here is the jQuery I have so far:
Code:
(function ($) {
$.fn.fixedMenu = function () {
return this.each(function () {
var menu = $(this);
menu.find('ul li > a').bind('click', function () {
//check whether the particular link has a dropdown
if (!$(this).parent().hasClass('single-link') && !$(this).parent().hasClass('current')) {
//hiding drop down menu when it is clicked again
if ($(this).parent().hasClass('active')) {
$(this).parent().removeClass('active');
}
else {
//displaying the drop down menu
$(this).parent().parent().find('.active').removeClass('active');
$(this).parent().addClass('active');
}
}
else {
//hiding the drop down menu when some other link is clicked
$(this).parent().parent().find('.active').removeClass('active');
}
})
});
}
})(jQuery);