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

What is Framer? Join the Community
Return to index
Dory Little
Posted Mar 12 - Read on Facebook

Hey guys - whats the best way to calculate the coordinates of a click event. Specifically when viewing within a device frame?

6 Comments

Johannes Tonollo

have you tried: print event.x

Dory Little

Yeah that works when doing anything full screen but when working within a device frame it seems to offset the position of the click event. The value that print event.x returns seems to be the same but the position on screen is different.

Koen Bok

Yep you have to correct for the Device. Here is an example how to do that. I'll have it added to Framer soon.

http://cl.ly/2D3e1Q3o473Z

Dory Little

awesome thanks Koen Bok

Chris Lee

Koen, was this ever added to Framer?

Koen Bok

Almost almost, I know this is a pain in th b*tt.

Read the entire post on Facebook