By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,017 Members | 1,169 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,017 IT Pros & Developers. It's quick & easy.

Is there a way to detect the width of the browser scrolling bar?

P: n/a
Hi at all.

Is there a way to detect with javascript the scrolling bar with of the
browser?

My problem is that the the following script assing to the pos
variable the browser window size but only internet explorer substracts
the scrolling bar with from the result.
<script language="JavaScript" type="text/JavaScript">
<!--
var pos;

if (window.innerWidth)
{
pos =window.innerWidth;
}
else if (document.documentElement &&
document.documentElement.clientWidth)
{
pos= document.documentElement.clientWidth;
}
else if (document.body)
{
pos= document.body.clientWidth;
}

//-->
</script>

At least i want to ask if there is a script that return exactly the
width of the browser's window that i have to output any text or
graphic?

Thanks in advance.
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
mbasil7 wrote:
Hi at all.

Is there a way to detect with javascript the scrolling bar with of the
browser?

My problem is that the the following script assing to the pos
variable the browser window size but only internet explorer substracts
the scrolling bar with from the result.
For a pretty thorough treatment of browser viewport issues, have a look
at the 'viewport' link at Quirksmode:

<URL:http://www.quirksmode.org/>
<script language="JavaScript" type="text/JavaScript">
The language attribute is depreciated, remove it. Keep the required
'type' attribute.
<!--


Hiding scripts is not necessary, potentially harmful and of zero
benefit.

[...]

--
Rob
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.