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

What is Framer? Join the Community
Return to index
Joe Lifrieri
Posted Jul 17 - Read on Facebook

How do you access the document element in Framer? It returns undefined any time I try and access it. Thanks!

9 Comments

Maykel Loomans

How are you trying to access it? Do you havea code snippet?

Joe Lifrieri

myLayers["SCROLL"].height = document.innerHeight

Maykel Loomans

Try Screen.height

Joe Lifrieri

That value, while not throwing any errors, is a lot shorter than the actual height of my viewport in Framer Studio. Any idea why that could be?

Maykel Loomans

As I don't have it in front of me; throw a huge back layer in that becomes a framer element and refer to that? :D

Joe Lifrieri

Figured it out: Screen.height is tied to the Content zoom %. So if you have your content at 50%, you need to do Screen.height * 2

Maykel Loomans

Truth.

Aaron Carámbula

oh that's weird. that's related to the drag speed being thrown off by zooming, which sucks for imported files that are 2x. Koen Bok, it'd be sweet if framer studio did that division across the board.

Joe Lifrieri

Aaron Carámbula yeah it gets tricky when you're switching between display modes (device vs fullscreen)

Read the entire post on Facebook