w3resource logo


JavaScript Window Object - scrollbars Property

JavaScript Window Object : scrollbars Property

rating Average rating 1 out of 10. Total 1 users rated.

<<PreviousNext>>

Description

The scrollbars property of the window object refers the browser window's vertical and horizontal scroll bars for the document area. The value of the scrollbars property itself has one property, visible. The scrollbars bar are visible if it is true and hidden if is false.

Version

Implemented in JavaScript 1.2

Syntax

window.scrollbars

Example of Window Object : scrollbars property

In the following web document scrollbars property test whether the scrollbars is visible or not.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JavaScript window object. scrollbars property Example-1</title>
</head>
<body>
<h1 style="color: red">JavaScript window Object :scrollbars Property</h1>
<hr />
<script type="text/javascript">
//This is done to make the following JavaScript code compatible to XHTML. <![CDATA[ 
alert(window.scrollbars.visible);
//]]>
</script>
</body>
</html>

View the example of window object's scrollbars property in the browser

Supported Browser

Internet Explorer 7 Firefox 3.6 Google Chrome 7 Safari 5.0.1 Opera 10
Yes Yes Yes Yes Yes

See also :

JavaScript Client side objects, methods, properties.

JavaScript Core objects, methods, properties.



<<PreviousNext>>