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

What is Framer? Join the Community
Return to index
Harsharanga Patil
Posted Apr 21 - Read on Facebook

I have created a html component. I want to call a function form that component. Is it possible? If yes then how is it done?
Example :

myFunction = () ->
# do something in coffee script code

html :
<li onclick="myFunction()">DATA</li>

4 Comments

Trevor Phillippi

Hope this helps. Fiddled a bit and discovered that it will only handle events properly if you add a handler to containing layer (but it doesn't have to do anything) http://share.framerjs.com/kybsjkesr9y3/

Trevor Phillippi

For html elements like <input> or <textarea> or even a div with contenteditable=true, I'm assuming those events bubble up out of the box, but if it's just your run-of-the mill <div> or <ul> Framer wont catch the events unless you listen on the parent layer.

Trevor Phillippi

Here's an example using list elements http://share.framerjs.com/i9bvln1rrasp/

Harsharanga Patil

Thanks a lot! It helps..

Read the entire post on Facebook