Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to show a cursor when mouse is hover on the timeline #1678

Open
PorterNan opened this issue Sep 8, 2023 · 3 comments
Open

Comments

@PorterNan
Copy link

PorterNan commented Sep 8, 2023

Hi! I've been using timeline for a while and it's been amazing, and now I am trying to implement a cursor(all across groups) and follow the mouse when hovering on timeline all the time. The way I was planning to implement it is:

  1. Listen to mouse hover event on timeline
  2. Get the time stamp
  3. set current time

But I noticed for 1, it only works when you hover on an item not the timeline itself, so wondering if there is a better/simpler way to implement this .

@esemplare
Copy link

esemplare commented Sep 23, 2023

Use mouseMove event to receive an event when the mouse moves within the timeline. See time and snappedTime properties of the event.

timeline.on("mouseMove", onMouseMove)

@PorterNan
Copy link
Author

yea... I usied that event, but it feels that event only triggered when mouse is on a item, lemme double check if I just got a wrong memory

@PorterNan
Copy link
Author

Just validated that and it works! Thanks for sharing that code snippet, there is one more interesting question comes up now, when I call timelineInstance?.addCustomTime(event.time); it create a dragabble line which always stay under my mouse, so I can do any other operation like click and drag for other items

Is there a solution for this?

setCurrentTime looks fine, but it is moving all the time, if there is a way to pause it as it is, that would be nice as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants