Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Disable click event on results ? › Reply To: Disable click event on results ?
July 28, 2023 at 11:16 am
#44844
Keymaster
Hi,
I would suggest using this custom code to override the default event handlers:
add_action('wp_footer', 'asp_custom_footer_script', 99999);
function asp_custom_footer_script() {
?>
<script>
window.addEventListener("load", (event) => {
let $ = WPD.dom;
$('.asp_m').on('asp_results_show', function(){
$('.asp_r .item').on('click', function(e){
e.preventDefault();
e.stopImmediatePropagation();
// your custom code here
});
});
});
</script>
<?php
}
Within this you can add your own event handler as you need it.