mardi 6 février 2018

Error using MixItUp filtering on pages that don't have any filtering

I've got mixitup working on my homepage only. I'm doing a very basic one with:

var containerEl = document.querySelector('.slides');
var mixer = mixitup(containerEl);

but I'm getting a Uncaught Error: [MixItUp] An invalid selector or element reference was passed to the mixitup factory function error on any page that's .slides is not present. Do I need an if statement or something to get this to only load if .slides is on the page?

Aucun commentaire:

Enregistrer un commentaire