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

What is Framer? Join the Community
Return to index
Josh Ackerman
Posted Feb 14 - Read on Facebook

Hello,

I created a radial menu in FramerJS. To finalize it I am wondering two things: how to make an event handler for right click, and how to get a layer to track the cursor.

Thank you.

Edit: Just incase the .gif does not work: http://drbl.in/njQt

4 Comments

Ryhan Hassan

To create a right click menu, show your menu layer at e.clientX / e.clientY on the "contextmenu" event

document.addEventListener "contextmenu", (e) ->
#print e.clientY
e.preventDefault()

Josh Ackerman

Thanks. One more question do you have any idea how to make the layers animate out from the cursor, as opposed to from the last position or some arbitrary location? Here is a link to the project http://share.framerjs.com/s53thuy00d64/

Ryhan Hassan

I tend to avoid creating one-off states on events - instead I tend to use .animate. If you're really used to using states, you could separate the positioning of the menu from the reveal animation by putting it in a container layer that's easy to manipulate. http://share.framerjs.com/45qi4d88fboz/

Josh Ackerman

Thank you! The menu works flawlessly.

Read the entire post on Facebook