Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    true innerWidth for Mozilla

    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...
    http://meidevelopment.meierinc.com/s...e/default.aspx

    TIA
    Last edited by nicora; 03-09-2005 at 04:21 PM.

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    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)
    }
    //-->
    </SCRIPT>
    <p><a href="#null" onclick="info()"><b>View</b></a>
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.

  • #3
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ah document.body.offsetWidth is what I needed

    kudos Mr J, much appreciated!

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    you may try also:

    document.getElementsByTagName('body')[0]
    or
    document.documentElement

    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?
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #5
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    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
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •