Skip to content

UI.innerWidth

UI.innerWidth is a read-only property that returns the width of the browser’s viewport, in pixels.

The viewport refers to the visible area of the page, excluding browser chrome such as the address bar, tabs, and window borders.

Usage

js
var w = UI.innerWidth

Example

js
if(UI.innerWidth < 800){
	I.see(".mobile-menu")
}

In the example above, the test checks if the element ".mobile-menu" is visible if the viewport width is less than 800 pixels.