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

What is Framer? Join the Community
Return to index
Leslie Liu
Posted Apr 02 - Read on Facebook

Hi,
Is there any way to trigger a double click event on framer? Like double click on images to zoom in.

6 Comments

Ian McClure

You need a variable to count the clicks.

clickCount = 0
layer.on Events.click, ->
clickCount += 1
if clickCount >= 2 then
# do stuff

Erik Edhagen

On top of Ians solution, you would probably want a timer to limit the double click delay (right now, every click after the first one will trigger the double-click action)

Erik Edhagen

On the other hand - there's actually a double click event in Javascript. Don't know if it's supported by Framer's Events though.

Ian McClure

Yes, I forgot about the delay. Thank you!

Leslie Liu

Erik Edhagen Ian McClure Thank you. I'll try it. : )

Erik Edhagen

Hint: use setTimeout after "clickCount +=1" and make the setTimeout callback reset clickCount to 0

Read the entire post on Facebook