Skip to content

Instantly share code, notes, and snippets.

@Zeko369
Created April 18, 2020 19:01
Show Gist options
  • Save Zeko369/6295665c4bf74c9d3aac00216b23dfb6 to your computer and use it in GitHub Desktop.
Save Zeko369/6295665c4bf74c9d3aac00216b23dfb6 to your computer and use it in GitHub Desktop.
document.querySelectorAll('.sviHoverKurci').forEach((elem) => {
const fn = (add) => () => {
const thingy = document.querySelector('.thingy');
if (add) {
thingy.classList.add('.class');
} else {
thingy.classList.remove('.class');
}
};
elem.addEventListener('mouseeneter', fn(true));
elem.addEventListener('mouseexit', fn(false));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment