Home > Enterprise >  How to open BeRocket Filters on hover instead of click event, WordPress?
How to open BeRocket Filters on hover instead of click event, WordPress?

Time:10-22

I downloaded the BeRocket AJAX Filter plugin and i need some jquery customization.

Currently the filters which are created using plugin open on click event only. We need to allow user to open the filters on hover instead of click event

I tried using below jquery which I get from the plugin reference but not working

jQuery(document).on('hover', '.bapf_ocolaps .bapf_colaps_togl, .bapf_ccolaps .bapf_colaps_togl', function(e) {
    e.preventDefault;
    if( jQuery(this).closest('.bapf_ocolaps, .bapf_ccolaps').is('.bapf_ocolaps' ) ) {
        jQuery(this).closest('.bapf_ocolaps, .bapf_ccolaps').trigger('bapf_ocolaps');
    } else {
        jQuery(this).closest('.bapf_ocolaps, .bapf_ccolaps').trigger('bapf_ccolaps');
    }
});

I tried jquery filter provided by plugin, but all filters are executable only after click event

Any help appreciated

URL: https://staging10.cheapassbikes.nl/shop/

Thanks

CodePudding user response:

You can use JQuery mouseover and mouseout events. check below code.

jQuery(document).on('mouseover', '.bapf_sfilter', function(e) {
    jQuery(this).find('.bapf_body').show();
});

jQuery(document).on('mouseout', '.bapf_sfilter', function(e) {
    jQuery(this).find('.bapf_body').hide();
});
  • Related