dots Created with Sketch.
Yogesh Chauhan's Blog

Window innerHeight and innerWidth properties in JavaScript

in JavaScript on April 29, 2021

Window interface is a window that contains an HTML DOM.

The HTML doc is loaded in a window hence, it becomes the window interface.

innerHeight property

Since, innerHeight property is associated with the window interface, it returns the inner height of the window.

The return value is in pixels and a read-only. If a horizontal scrollbar is present then it includes it’s height in the return value.

innerHeight property Example

innerWidth property

Since, innerWidth property is associated with the window interface, it returns the inner width of the window.

The return value is in pixels and a read-only. If a vertical scrollbar is present then it includes it’s height in the return value.

innerWidth property Example

amazon

Most Read

#1 How to check if radio button is checked or not using JavaScript? #2 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #3 How to add Read More Read Less Button using JavaScript? #4 How to uninstall Cocoapods from the Mac OS? #5 PHP Login System using PDO Part 1: Create User Registration Page #6 How to Use SQL MAX() Function with Dates?

Recently Posted

#Jul 22 Is there a CSS parent selector? #Jul 22 Difference between :where and :is in CSS #Jul 22 Does :is() pseudo selector hint at CSS preprocessing in the future? #Jul 22 Control Scrolling with CSS Scroll Snap #Jul 21 Control rendering using CSS content-visibility property #Jul 21 How to use @supports rule in CSS?
You might also like these
How to Display Related Posts in WordPress?WordPressWhy does MOV matter in IT or any kind of projects?MiscellaneousHow to define constants in PHP?PHPHow to create a Horizontal Scroll on button click using JavaScript?JavaScriptLearn to Make a Simple Contact Us Form using PHP and PDO-MySQLPHPCreate dynamic selectors using SCSS (Sass)SCSSWordPress: How to find all posts with a specific custom field value?WordPressLearn to Establish Connection using MySQLi (object-oriented), MySQLi (procedural) and PDO with Example CodePHPHow to create a flip effect with CSS?CSSHow states work in React?ReactHow to get the full URL of current page in PHP?PHPHow to swap images on hover using CSS?CSS