KarelRuzicka
KarelRuzicka

Reputation: 471

Remove element manually using mixitup

I want to hide certain elements in my already filtered div with mixitup. According to kunkalabs documentation here I should be able to do this by calling the .remove() method.

I tried it on one of theirs examples and I wasn't able to get it working. It always shows an error. I have an example here: https://jsfiddle.net/gtr347mh/

I took this directly from the documentation so I have no idea why it's not working:

 var containerEl = document.querySelector('.container2');

        var mixer = mixitup(containerEl, {
            multifilter: {
                enable: true
            },
            animation: {
                effects: 'fade translateZ(-100px)'
            }
                        });

            var elementsToRemove = containerEl.querySelectorAll('.toremove');

            console.log(elementsToRemove.length)

            mixer.remove(elementsToRemove)
                 .then(function() {
                     console.log(containerEl.querySelectorAll('.toremove').length);
                 });

It should hide any div with the class "tohide" but it doesn't.
Is there any way to fix this?

Upvotes: 1

Views: 301

Answers (0)

Related Questions