Android browser's screen.width, screen.height & window.innerWidth & window.innerHeight are unreliable

后端 未结 8 1574
一个人的身影
一个人的身影 2020-12-05 02:53

I\'m working on a web app that is targeted to browsers on desktop, tablet and smartphone.

The web app has a light box implemented using Colorbox with an iframe

8条回答
  •  难免孤独
    2020-12-05 03:12

    Below is differentiation based on readings with Samsung Tab running Android 4.1

    • screen.height - gives actual device height including task bar and title bar

    • window.innerHeight - gives the height excluding task bar, title bar and address bar(if visible)

    • window.outerHeight - gives the height excluding task bar and title bar height, (no matter address bar is visible or hidden, outerHeight include the address bar height.)

提交回复
热议问题