I have a code for an animated search bar, but the animation does not work along with submitting the search. I believe it's the "e.preventDefault ();" that I can not bring the event after the animation:
<form action='/search' method='get'>
<input id="search" type="search" name="q" />
<p></p>
</form>
<script>
var form = $('form'),
search = $('#search');
form.submit(function(e) {
e.preventDefault();
search.addClass('searching').val('');
setTimeout(function() {
search.removeClass('searching');
}, 3600);
event.currentTarget.submit(); // Com essa linha consigo enviar mas a pesquisa digitada não vai
});
</script>