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

What is Framer? Join the Community
Return to index
Jon Knoland Blair
Posted Feb 09 - Read on Facebook

$(window).height(); is not returning the correct value, any idea why?

8 Comments

Andy Jakubowski

I don’t know why your code doesn’t work, but I usually use window.innerHeight. Is that what you’re looking for?

Ryhan Hassan

You're using jquery syntax - framer studio prototypes don't come with jquery by default

Jon Knoland Blair

Ryhan Hassan I've added jquery to my project

Jon Knoland Blair

I figured out what the issue was. I have a line: mymap.html = "<div id='map-canvas' style='height:2000px'></div>"

I need a way to add a javascript variable in place of height, but document.getElementById doesn't work with framer layers

Jon Knoland Blair

Also this is what I get with innerHeight: http://puu.sh/fHoQd/72b34ce3a4.png

Andy Jakubowski

Right, this will only work if you use the full screen mode. That’s probably because all the devices have high density screens where 1 device pixel is not equal to 1 screen pixel...

Jon Knoland Blair

I'm still getting it when I'm fullscreen on the iPhone

Jordan Robert Dobson

You want something more like Device.Framer.screen.height.

Read the entire post on Facebook