Filter Ads on Front Page with JQuery
Hi everyone!
So I'm trying the following thing:
I gave specific classes to all ads.
For Ads with the currency EUR: <div class="post-block-out eur" ... ></div>
For Ads with USD: <div class="post-block-out usd" ... ></div>
Then I created two buttons (<button>) on the Front Page.
Button 1: Only show EUR
Button 2: Only show USD
Now this is what I want:
When I click the button EUR, I want the front page only to show ads with the currency EUR.
When I click the button USD, I want only to see USD ads.
This should work with JQuery/AJAX - so the ads should load automatically without refreshing the whole page!
I tried this tutorial:
https://codepen.io/terf/post/jquery-filter-divs
But the Ads (Divs) doesnt align automatically (as they should) when I click the EUR button for example. When I scroll (I'm loading ads automatically when scrolling down) the ads align only vertically and again USD ads are displayed.
PLEASE. HELP!