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

What is Framer? Join the Community
Return to index
Ola Laurin
Posted Sep 17 - Read on Facebook

Does anyone have an idea of how to recreate this demo in Framer:

I guess I'm asking there's a way to use offsetLeft, scrollLeft and clientLeft in Framer.


Andreas Wahlström

Haven't read the tutorial but from looking at the example you should be able to use circle's midX property and animate to event.offsetX. Then do the same for Y


Just animate the midX and midY:

containerLayer = new Layer
width: Screen.width
height: Screen.height
backgroundColor: "white"

l = new Layer
width: 100
height: 100
borderRadius: 100/2
backgroundColor: "brown"

containerLayer.on Events.Click, (e)->
console.log e

midX: e.clientX
midY: e.clientY

Jonas Treub

Inspired by Linda Dong I created the following example:

Ola Laurin

Thanks! It doesn't work with touch though. If it's a touch enabled device I should use pageX else it's offsetX, like in your example. Need a good way to sniff out whether the user is using touch enabled device or a mouse now. Hmm :)

Ola Laurin
Ola Laurin

Now it works with both touch and mouse.

Jordan Robert Dobson

Here's a module I posted that helps solve this:

Read the entire post on Facebook