View Full Version : true innerWidth for Mozilla

03-09-2005, 07:30 AM
hello, I have a little script that has a cursor follow the mouse only over a menu. for each section I have the cursor start under the current menu item.

I am having a problem in Mozilla, however. it seems that neither "window.screen.availWidth, window.innerWidth or screen.width" want to take into consideration the vertical scroll bar. I'm sure it is something small, maybe one of you guys could take a peek for me?

This is my beta site, which has not been launched yet...


Mr J
03-09-2005, 03:20 PM
Using the following script in each browser will show you the relevant sizes

<SCRIPT language="javascript">
function info(){

alert("Document.body.clientWidth = "+document.body.clientWidth
+"\n\nDocument.body.clientHeight = "+ document.body.clientHeight
+"\n\nDocument.body.offsetWidth = "+document.body.offsetWidth
+"\n\nDocument.body.offsetHeight = "+document.body.offsetHeight)
<p><a href="#null" onclick="info()"><b>View</b></a>

03-09-2005, 04:24 PM
ah document.body.offsetWidth is what I needed

kudos Mr J, much appreciated!

03-09-2005, 05:21 PM
you may try also:


as reference of the body(document itself)

I have sensed that document.body is to be turned into a deprecate reference in the near future... Is it so?

Mr J
03-09-2005, 06:05 PM
document.body is to be turned into a deprecate reference in the near future

Not too sure Kor but it's nice to know, thanks :thumbsup: