Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Display Search and Hide it on anywhere click
// Header Search
$('.search a').on('click', function(event){
var search = $(this).attr('href');
$(search).css('right', '0');
// Hide search on document click
var container = $('#search');
if (! && container.has( === 0){
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment