DEV Community

Discussion on: Hover to toggle between functions in JS

Collapse
 
berniwittmann profile image
Bernhard Wittmann

I created a small fiddle to solve this: JSFiddle

The key is to add event listeners to the hover div for mouseover and mouseleave. So the corresponding functions are called upon hover or leaving the hover state.

If you have more questions, just let me know