Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Show suggestions only when search is opened › Reply To: Show suggestions only when search is opened
December 5, 2022 at 10:43 am
#40385
Keymaster
That should be doable too. Please use this instead of the second suggested code:
add_action('wp_footer', 'asp_footer_custom_script', 999999);
function asp_footer_custom_script() {
?>
<script>
jQuery(function($){
$('input.orig').on('focus', function(){
$('p.asp-try').css('opacity', 1);
}).on('blur', function(){
$('p.asp-try').css('opacity', 0);
});
});
</script>
<?php
}
This will restore the invisibility too, when the input gets out of focus.