Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Force results div to close, after click › Reply To: Force results div to close, after click
September 11, 2023 at 2:40 pm
#45346
Keymaster
Hi Tom,
I recalled someone else asked for a similar behavior, I recommended this custom code then:
add_action('wp_footer', 'asp_add_footer_script', 99999);
function asp_add_footer_script() {
?>
<script>
jQuery(function($){
jQuery('body').on('click', '.asp_r .item', function(){
ASP.api(1, 'closeResults');
});
});
</script>
<?php
}
This should do the trick.