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

What is Framer? Join the Community
Return to index
Srdjan Markovic
Posted Oct 31 - Read on Facebook

Is there a way to detect onMouseUp (or TouchEnd) event outside a clicked layer?


Krijn Rijshouwer

Hey Srdjan,

Yes! There's a simple way to do this. Check out this example I made you →

Srdjan Markovic

Thanks, Krijn but, unfortunately, this is not what I am looking for. Imagine clicking a red button and changing its colour to green. And while the mouse button is still down, dragging and releasing the mouse button outside the area of the clicked button. The button should reverse its colour to red again.
Problem is that Framer listens for mouseUp event only within the area of the object with mouseUp event attached.
I solved it by applying mouseUp event to document.body and some additional code which track which element fired mouseDown event. It's pity not to have mouseUpOutside event by default if Framer.

Read the entire post on Facebook