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

What is Framer? Join the Community
Return to index
Rebecca Gold
Posted Jul 22 - Read on Facebook

Has anyone used Events.Scroll? I want some images to load as I scroll down the page. If my import is called PSD, would I just use "SD.on Events.Scroll, ->
PSD.animate"?
I'm not getting anything working so far

9 Comments

Koen Bok

To access a layer, you need to reference it by it's name:

PSD.myLayer.on Events.Scroll, -> ...

Rebecca Gold

I want it to detect a user scrolling down the page, so don't I need Events.Scroll on all my layers?

Min-Sang Choi

I suggest to check your naming first.

If your imported layer name is PSD, then you should name it as PSD[“your layer group”]. so whole syntax should go like this.

PSD[“your layer group”].on Events.Scroll, ->

PSD[“your layer group”].animate
//animated

If you named it properly, then you should check if you made sure target layer scrollable. you have to make a layer that is smaller than target layer(or you can make a layer group on Photoshop), and add your target layer as sublayer. like;

scrolllayer = new Layer x:0, y:0, width://smaller-than-PSD, height://same as width
scrolllayer.addSublayer(PSD[“your layer group”])
scrollayer.scroll = true

Rebecca Gold

thank you, i'll try this. is "your layer group" just a list of all the layer names in the PSD?

Min-Sang Choi

Rebecca Gold no, it's your layer group's name. you should group your layers to import properly.

Rebecca Gold

Ok, so if I have PSD = Framer.Importer.load "imported/Rebecca_Homepage_OPEN", it would be (PSD["imported/Rebecca_Homepage_OPEN"])?

Rebecca Gold

Sorry, i'm new to this!

Koen Bok

No problem! You need the actual layer group name within the document.

Aaron Carámbula

You can't scroll the all the layers or layer groups. You can group all of them in photoshop into one layer group, name it "App Scroll" or something.

Then you would refer to PSD["App Scroll"] for the event

Make sure to set PSD["App Scroll"].height to something shorter than all of the layers inside of it to make it scroll.

Read the entire post on Facebook