This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Brandon Souba
Posted Aug 13 - Read on Facebook

Looking to print the x/y position of the pointer / mouse after a click. Any ideas on how to achieve this?

7 Comments

George Kedenburg III

pass the event in your click function and then print event.offsetX i think

Joshua Tucker

LOL didn't change the one below to "y", but yeah.

Joshua Tucker

To George Kedenburg III's point, there's a few different event types for coordinates. https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent

Such as screen.x, client.x, page.x, etc. (depends if you're looking to make it mobile-compatible).

Jordan Robert Dobson

I have a fix for this. I'll post up my position class in a few min.

Jordan Robert Dobson

http://share.framerjs.com/pdqtuxeswkk8/

This may be of help... let me know if this could be simplified at all. :D

Jordan Robert Dobson

Does this help you guys out?

Brandon Souba

yep thanks!

Read the entire post on Facebook