Search code examples
jqueryiphonesafariheight

jQuery $(window).height() don't work correctly in safari


I was using jQuery $(window)height() to get the height of view-port. This works in all browsers expect safari browser in iPhone 6. It don't give correct height of view-port. I also tried window.innerHeight, but results are same. Any help?


Solution

  • I will refer you to this post. There is a hacky fix, but it boils down to a bug in Safari mobile (that might also apply to Safari desktop)

    Mobile Safari $(window).height() URL bar discrepancy