Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get window height on mobile devices (especially iPhones) without using jQuery

All the answers on SO for fetching the device's height seem based on jQuery. We need something in pure JavaScript before the jQuery code loads.

like image 671
Crashalot Avatar asked Aug 14 '13 22:08

Crashalot


2 Answers

document.documentElement.clientHeight

There are a number of other methods, too: http://responsejs.com/labs/dimensions/

like image 101
Pete Scott Avatar answered Nov 12 '22 16:11

Pete Scott


May be a little late, but use window.screen.height

like image 13
jorgejeferson Avatar answered Nov 12 '22 16:11

jorgejeferson