I've been trying to get the viewport height using jQuery in mobile Chrome, however this is returning a different result when the address bar is/isn't present.
I'm testing on Browserstack using Samsung Galaxy S5. When i scroll down and release so the address bar in Chrome is hidden I get a different reading to when the page loads or i'm scrolling up and the address bar is visible.
Is there a way to get the same height value regardless of whether the address bar is visible?
nb. I do have the doctype set
My code is:
$(window).resize(logHeight);
function logHeight() {
console.log($(window).height());
console.log($(document).height());
}
logHeight();