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

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

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

19条回答
  •  孤独总比滥情好
    2020-11-21 06:26

    To check height and width of your current loaded page of any website using "console" or after clicking "Inspect".

    step 1: Click the right button of mouse and click on 'Inspect' and then click 'console'

    step 2: Make sure that your browser screen should be not in 'maximize' mode. If the browser screen is in 'maximize' mode, you need to first click the maximize button (present either at right or left top corner) and un-maximize it.

    step 3: Now, write the following after the greater than sign ('>') i.e.

           > window.innerWidth
                output : your present window width in px (say 749)
    
           > window.innerHeight
                output : your present window height in px (say 359)
    

提交回复
热议问题