Jquery works only on double click
$(document).ready(function() { $(document).click(function(e) { e.preventDefault(); if ( !$(e.target).hasClass("header-disableProfileIcon") && $(e.target).parents(".header-user-profile-menu").length === 0 ) { $(".header-user-profile-menu").hide(); $(".header-disableProfileIcon").removeClass( "header-enableProfileIcon" ); $(".header-disableProfileIcon").off("dblclick"); } e.stopPropagation(); }); });
Source: stackoverflow.com