Get the size of the screen, current web page and browser window

前端 未结 19 2370
面向向阳花
面向向阳花 2020-11-21 05:29

How can I get windowWidth, windowHeight, pageWidth, pageHeight, screenWidth, screenHeight,

19条回答
  •  囚心锁ツ
    2020-11-21 06:30

    But when we talk about responsive screens and if we want to handle it using jQuery for some reason,

    window.innerWidth, window.innerHeight
    

    gives the correct measurement. Even it removes the scroll-bar's extra space and we don't need to worry about adjusting that space :)

提交回复
热议问题