Where to add js snippet on posts filtering action

Forums Forums Search & Filter Pro Where to add js snippet on posts filtering action

Viewing 2 posts – 1 through 2 (of 2 total)
  • Anonymous
    #55806

    Hi there,

    I need to add this js snippet into your plugin:

    jQuery(‘.listing-grid .detail’).matchHeight();

    After filtering posts I would like to keep equal heights of divs in my grid.

    Where can I add it and activate this function?

    Thanks!

    Trevor
    #55809

    I would depend on the action of the form. If Ajax is on, you need to add the snippet to your theme page like this:

    $(document).on('sf:ajaxfinish', '.searchandfilter', function(){
    	console.log("ajax complete");
    	jQuery('.listing-grid .detail').matchHeight();
    });

    Otherwise, you need to load that script as the results page loads, again from your theme.

    You might also consider using flexbox css as an alternative, thus avoiding any use of javascript.

Viewing 2 posts – 1 through 2 (of 2 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.