Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created March 8, 2017 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/10066e5fc649e560631620809a6d176e to your computer and use it in GitHub Desktop.
Save billerickson/10066e5fc649e560631620809a6d176e to your computer and use it in GitHub Desktop.
jQuery(function($){
$(document).on('mouseup touchend', (function(e){
containers = [ '.nav-primary .menu-item.follow.active', '.nav-primary .menu-item.search.active'];
$.each( containers, function( key, container ){
var item = $(container);
if( ! item.is(e.target) && item.has(e.target).length === 0 ) {
item.removeClass('active');
}
});
}));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment