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

What is Framer? Join the Community
Return to index
Thomas Werres
Posted Aug 21 - Read on Facebook

Hi, just a question from an absolutely beginner. When I start scrolling a layer I would like to execute something. Trying this code to run doesnt work:

PSD["content"].on Events.Scroll, ->
PSD["activity"].visible = false

The console shows the error "Uncaught SyntaxError: Unexpected identifier"

Thanks a lot in advance!

2 Comments

Alex Hazel

First, make sure your spacing and tab indents are correct (in coffeescript, spacing is crucial). This is hard to figure out from text posted in a Facebook message....

Maybe try putting it into a function and then calling the function on the scroll event:

hide = ->
PSD["activity"].visible = false

PSD["content"].on Events.Scroll, (e) ->
hide();

Thomas Werres

Hello Alex, thanks for your reply! I still write in JS and I havent switched to coffeescript so far. Sorry, if I missed to point in that in the post. For those who are interested....this works in JS:

PSD["content"].on("scroll", function(e) {
PSD["activity"].visible = false
});

Read the entire post on Facebook