Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save VasylKyryliuk/79355a0fb3b27ce48b6db422a3f56caf to your computer and use it in GitHub Desktop.
Save VasylKyryliuk/79355a0fb3b27ce48b6db422a3f56caf to your computer and use it in GitHub Desktop.
Дія при кліку по любому місці
$(document).click(function(e){
if ($(e.target).closest("#header-search #search_mini_form").length) return;
$('#header-search #search_mini_form').removeClass('active');
e.stopPropagation();
});
АБО
$(document).mouseup(function (e) {
var container = $(".header-user-block");
var minicartTop = $(".header-minicart");
if (container && minicartTop.has(e.target).length === 0){
$('div#header-account').removeClass('skip-active');
$('a.skip-account').removeClass('skip-active');
$('div#header-cart').removeClass('skip-active');
$('a.skip-cart').removeClass('skip-active');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment