Difference between screen.availHeight and window.height()

后端 未结 2 1668
闹比i
闹比i 2020-11-28 18:42

I am executing the following Javascript on my browser (Firefox).

  1. console.debug(\"Screen height = \"+ screen.availHeight); //outputs

2条回答
  •  暖寄归人
    2020-11-28 19:45

    Wanted to correct a thing stated in @jigfox 's answer:

    https://www.w3schools.com/jsref/prop_screen_availheight.asp#:~:text=The%20availHeight%20property%20returns%20the,)%2C%20use%20the%20availWidth%20property.

    The availHeight property returns the height of the user's screen, in pixels, minus interface features like the Windows Taskbar.

    Tip: To get the height of the screen (excluding the Windows Taskbar), use the availHeight property.

提交回复
热议问题