Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript On body click, hide search Re: On body click, hide search

#132572
CrocoDillon
Participant

Pixelgrid beat me to it while writing the code:

var search = $(‘.search’);
$(‘.find’).click(function() {
search.slideDown(‘slow’).focus();
});
search.on(‘blur’, function() {
search.slideUp(‘slow’);
});

Only problem I’m trying to find the solution to is that when you click Find again it doesn’t hide it. This isn’t a big deal I think but it does play the animation again, which is weird.