Nwebie : Getting the value of a resized browser window

Discussion in 'Javascript' started by andy.jones@fdtassociates.com, Sep 8, 2006.

  1. Guest

    Hi

    I'm new to Javascript and wonder if anyone can give me some help?

    Im using document.documentElement.clientWidth to get the width of the
    users
    browser and it works fine so long as the users don't resize it.
    However, if the
    user re sizes it and then refreshes it , everthing is correct).

    what I would like to detect is the width of the window dynamically as
    the
    user rezizes it.

    does anyone know if this is possible

    thanks

    Andy
    , Sep 8, 2006
    #1
    1. Advertising

  2. Randy Webb Guest

    said the following on 9/8/2006 6:09 AM:
    > Hi
    >
    > I'm new to Javascript and wonder if anyone can give me some help?
    >
    > Im using document.documentElement.clientWidth to get the width of the
    > users
    > browser and it works fine so long as the users don't resize it.
    > However, if the
    > user re sizes it and then refreshes it , everthing is correct).
    >
    > what I would like to detect is the width of the window dynamically as
    > the
    > user rezizes it.
    >
    > does anyone know if this is possible


    window.onresize

    Be aware that it fires continuously until the resize is finished.
    Meaning, that if you resize the window 100 pixels wider (or narrower)
    then the onresize will get fired 100 times.

    There is also the IE-centric onresizeend

    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
    Randy Webb, Sep 8, 2006
    #2
    1. Advertising

  3. Guest

    Re: Nwebie : Getting the value of a resized browser window

    Many thanks Randy

    I'll give it a go

    Andy
    Randy Webb wrote:
    > said the following on 9/8/2006 6:09 AM:
    > > Hi
    > >
    > > I'm new to Javascript and wonder if anyone can give me some help?
    > >
    > > Im using document.documentElement.clientWidth to get the width of the
    > > users
    > > browser and it works fine so long as the users don't resize it.
    > > However, if the
    > > user re sizes it and then refreshes it , everthing is correct).
    > >
    > > what I would like to detect is the width of the window dynamically as
    > > the
    > > user rezizes it.
    > >
    > > does anyone know if this is possible

    >
    > window.onresize
    >
    > Be aware that it fires continuously until the resize is finished.
    > Meaning, that if you resize the window 100 pixels wider (or narrower)
    > then the onresize will get fired 100 times.
    >
    > There is also the IE-centric onresizeend
    >
    > --
    > Randy
    > Chance Favors The Prepared Mind
    > comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    > Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
    , Sep 11, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Don
    Replies:
    29
    Views:
    963
    dorayme
    Oct 27, 2006
  2. K Viltersten

    Adjust a canvas as the window is resized

    K Viltersten, Mar 8, 2008, in forum: Python
    Replies:
    2
    Views:
    3,536
    K Viltersten
    Mar 10, 2008
  3. Replies:
    0
    Views:
    136
  4. bbxrider

    nwebie onsubmit

    bbxrider, Jul 27, 2003, in forum: Javascript
    Replies:
    1
    Views:
    111
    bbxrider
    Jul 27, 2003
  5. Despoina
    Replies:
    2
    Views:
    146
Loading...

Share This Page