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

What is Framer? Join the Community
Return to index
Braden Hamm
Posted Jun 06 - Read on Facebook

Need help with Cemre Güngör's helpful library.js shortcuts.

I'm trying the layer.slideToTop functions. In the script comments it says to "wrap your project in a layer named Phone or set defaults to whatever your wrapper layer is."

Can I get more clarification, maybe an example, of how to add a wrapper and where or what my current wrapper layer is so I can change it?

I'm working on something with a specific size for a modal, so Phone won't work.

9 Comments

Cemre Güngör

All those slide functions work best when you're prototyping full-screen mobile apps. I don't think it'd work for a modal (it'd stick to the top of the screen :).

Cemre Güngör

But to get that to work, you need to have one View at the top-most level, containing everything else.

Cemre Güngör

And define it by:
Framer.Defaults.displayInDevice.containerLayer = TopView

Braden Hamm

But shouldn't it work if I define a specific size?

Cemre Güngör

You can define Framer.Defaults.displayInDevice.canvasWidth and ..height

Cemre Güngör

Are you trying to slide a whole screen into view? Then yep, it should work. Just define a container and its size

Braden Hamm

Yes, sliding the whole thing. Thanks! Such a quick response.

Braden Hamm

I can get the first layer to slide up exactly how I want it, but it only shows the default background, not the layer. It says the layer is undefined, but I'm calling it just as it's defined in layers.json, using the same method I did for the first layer. Any help?

Braden Hamm

Disregard. Found my problem.

Read the entire post on Facebook