JavaScript Window screen.availHeight property

The Window.screen.availHeight property in JavaScript represents the height of the screen (in pixels) available to the current web page, excluding the height of the operating system taskbar. It is a read-only property that returns an integer value.

Here is an example of how to use the Window.screen.availHeight property:

// get the height of the screen available to the current web page
var screenHeight = window.screen.availHeight;

// log the height of the screen
console.log("Screen height: " + screenHeight);

In the above code, we are using the Window.screen.availHeight property to get the height of the screen available to the current web page. We are then logging this value to the console.

Note that the value of the Window.screen.availHeight property may vary depending on the device and operating system being used. It is also affected by the presence of the operating system taskbar and any other UI elements that may be present on the screen.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: