Open Moniquezeitouny opened 6 years ago
This is what I have for my mouseover function:
'''var shapes = document.querySelectorAll('.shape'); shapes.forEach(function(shape, i) { shape.addEventListener('mouseover', function(event) {
if (shape.classList.contains('shape-interaction')) {
shape.classList.remove('shape-interaction');
} else {
shape.classList.add('shape-interaction'); }'''
I would imagine if you set color changing as the function, this should work for you. But personally I find color changing easier with CSS so I'd recommend that unless you're really adamant on using js.
how can i use mouseover to change color with js?