I am having problem of getting wrong height with
$(window).height();
and got the similar question here
In my case when I try
This fixed me
var width = window.innerWidth; var height = window.innerHeight;