Last active
June 19, 2022 13:08
-
-
Save ofmarconi/fa53493cf1f5fbabfab7865d84271acc to your computer and use it in GitHub Desktop.
inside each .item when mouse hovers over element .trigger add .open class to .triggered element inside each .item when mouse moves over element .trigger remove .open class to .triggered element (by askjarvis.io)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var acionadores = document.querySelectorAll('.item .acionador'); | |
for (var i = 0; i < acionadores.length; i++) { | |
acionadores[i].addEventListener('mouseover', function() { | |
this.parentNode.querySelector('.acionado').classList.add('aberto'); | |
}); | |
acionadores[i].addEventListener('mouseout', function() { | |
this.parentNode.querySelector('.acionado').classList.remove('aberto'); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment