I’ve been using the MixItUp tutorial from @sabanna and they have been working great. But I want to make it load a specific filter when a page loads and can’t find any help online other than the guides from the Kunka Labs page:
I am running into a wall and can’t figure out how to make the stuff provided from Kunka to work in Webflow.
Basically that I add the code in the body section (below) with the specific filter I want to load up placed in place of ‘category-2’ but it still is loading up as ‘all’ by default. Is there something else I am missing to adjust?
My page loads correctly but the MixItUp multifilter doesn’t work as it should when I use the other filters after load. I have tried using the following without luck (line 168+169) from this tutorial Issues · patrickkunka/mixitup · GitHub
<script>
// its mixitup all item parent
var mixer = mixitup('.mix-container',{
selectors: {
target: ".mix"
},
animation: {
duration: 300
},
load: {
filter: ".home-about" // default show this item on load
}
});
//set default active class on page load
$(document).ready( function () {
$('.navbar__menu li').removeClass('active');
$('.navbar__menu li a[data-filter=".home-about"]').parent().addClass('active');
})
// handle click events
$ ('.navbar__menu li a').click(function(event){
event.preventDefault(); //prevent the default behavior
var filter =$(this).data('filter');
mixer.filter('filter'); // apply filter using mixitup
$('.navbar__menu li').removeClass ('active'); //remove active class from the all item
$(this).parent().addClass('active'); // add active class to clicked item
})
</script>