Im trying to destroy VanillaTilt on few divs when screen size is smaller than 800px. Of course my function works with one div but not with few ones. I thought that i can use a querySelectorAl but i know right now that its not so simple. So i wrote down that code and im stuck. I dont know what's wrong with that. Can somebody help me with it ? Cheers
<div class='container'>
<div class='tilt-el'></div>
<div class='tilt-el'></div>
<div class='tilt-el'></div>
</div>
var destroy = document.querySelectorAll(".tilt-el");
var i;
var w = window.innerWidth;
VanillaTilt.init(destroy);
function unTilt(){
if( w <= 800) {
destroy.vanillaTilt.destroy();
}
};
for(i=0;i<destroy.length;i++){
destroy[i].addEventListener('mousemove', unTilt);
}