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

What is Framer? Join the Community
Return to index
Kostantinos Frantzis
Posted Aug 28 - Read on Facebook

Hey all, 2 quick questions.

1) I want a layer to stop being draggable beyond a line. I am setting draggable.speedX and speedY to 0 beyond that line and it kind of works but it is flickering when I pass that line. Is there another way? remember having seen a maxdragframe property (or something like that) somewhere before but cant find the documentation.

2) I have two layers sitting on top of each other. bottomLayer and topLayer (with alpha). Is there a way for a touch event to propagate to the bottomLayer? So i can listen for events on the bottomLayer without having to place it in front.

Cheers,
Kosta

2 Comments

Alex Hazel

about #2...Put a touch event on the bottom layer and log the click event to the console to see if you are getting feedback. Touch events should "bubble up" (from child to parent) the DOM unless you tell it otherwise. (i.e. e.stopPropagation() or e.preventDefault() or return or return false) So if the click event is on the bottom layer it should still receive input....Does it not?

Johannes Eckert

For #1 pay attention to the draggable basics example on the example site. I assume you are calculating the drag amount by comparing the layers position to the start position? That way, if you change speedX after reaching the line/threshold your math gets quirky because speed X also changes the position of the layer.
On the example site you see that the drag amount is calculated by the touch event, not the layer position. I posted a question regarding event.x on touch yesterday, you May want to look that up too

Read the entire post on Facebook