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

Nwebie : Getting the value of a resized browser window

P: n/a
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 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
an********@fdtassociates.com 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 8 '06 #2

P: n/a
Many thanks Randy

I'll give it a go

Andy
Randy Webb wrote:
an********@fdtassociates.com 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 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.