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

What is Framer? Join the Community
Return to index
Moses Tg
Posted Dec 05 - Read on Facebook

Is there a way to combine Utils.throttle with Events.TouchMove so TouchMove only triggers on the interval defined by the throttle?

2 Comments

Mike Feldstein

Messing with events like that probably isn't a good idea. What i would do is have an "ignore" variable that is set to true whenever TouchMove runs, and is cleared via setInterval. Then at the beginning of TouchMove you can check if that variable is true, and return early. Does that make sense?

Ryhan Hassan

I actually do this pretty frequently - keep in mind you'll need to ensure that things end up in the right state after TouchEnd. The syntax you need is basically:

myLayer.on Events.TouchMove, Utils.throttle 0.2, myFunction

Read the entire post on Facebook