This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Show suggestions only when search is opened

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

#40385
Ernest MarcinkoErnest Marcinko
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.