Animate cursor to specific menu item

I’m currently working on a menu. The aim is to move a cursor from its current position to the selected menu entry when clicking on a menu entry. Is there an easy way to do this?

Are you talking about the mouse cursor? It’s not possible to move that. If you’re talking about the ‘text’ cursor, there is a way to do this – just want to clarify, though it doesn’t seem like you are.

Thank you very much for your message.

By cursor I mean a kind of selector:

I want to build a vertical menu, like this:

MenuItem1
MenuItem2
MenuItem3 |
MenuItem4

Behind MenuItem3 is now the selector. When I click on MenuItem1, the selector should move animated to MenuItem1:

MenuItem1 |
MenuItem2
MenuItem3
MenuItem4

This means that the destination to which the selector is to be moved is dynamic.
How can I do this?

https://codepen.io/search/pens?q=context+menu+(right-click
:sonrojo::sonrojo:

on mouseover start a relative timeline that moves the optical selector …

2 Likes

Great! The principle with the relative time lines was not clear to me. Thank you very much for pointing me in the right direction.

2 Likes