I have an image with a hover effect (higher opacity when mouse is over it). It works as desired when the mouse moves in and out.

However, the image itself is moving (I'm periodically changing the css attribute top). When the mouse does not move and the image moves under the mouse cursor, no related events are triggered. That means, the hover functions are not called. I also tried using the mouseenter and mouseleave events instead, but they don't work either.

What would be a good approach to get the desired behavior (hover effect whenever the mouse is over the image, regardless of why it got there)?