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)