0
I need a preloader to be shown after the 'Enter' key is pressed in a search box. I have reached the conclusion below, but it does not work. Can you give me a hand?
<div id="preloader">
<div class="inner">
<div class="">
<div></div>
<div></div>
<div></div>
</div>
</div>
</div>
<div class="x-searchform-overlay">
<div class="x-searchform-overlay-inner">
<div class="x-container max width">
<?php echo get_product_search_form(); ?>
</div>
</div>
</div>
<script>
$(document).keyup(function(e) {
e.preventDefault();
if(e.which == 13 || e.keyCode == 13) {
$('.preloader').hide();
}
});
</script>
Before the
if
inserte.preventDefault();
and see if it works.– Andrei Coelho
No change..
– gnoronha
How’s your .preloader. class. What exactly isn’t working. Edit your question and put some more details.
– Deividson Oliveira
I updated the question.
– gnoronha
Here $('.preloader'). Hide(); shouldn’t be $('.preloader'). show();
– Deividson Oliveira