473,385 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Nwebie : Getting the value of a resized browser window

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
2 1325
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dan glenn | last post by:
hi. I want to code a 'preview' function into a guestbook entry page. I can do it with a button that posts, bringing up a whole new page showing a preview of what has been entered, and then the user...
21
by: Michael Bierman | last post by:
Please forgive the simplicy of this question. I have the following code which attempts to determine the color of some text and set other text to match that color. It works fine in Firefox, but does...
2
by: Dan | last post by:
Hello, I am just now converting from the world of DOS. Making simple VB.NET apps was easier than I expected. Now I need some control over the window that the app is running in. Can a VB.NET...
3
by: Atul | last post by:
Hi, I am running .NET Framework 2.0 on windows XP SP2. I am stuck in a situation where I need to find out a list of all active sessions running in IIS for a web application. I know that .NET...
3
by: KNDesign | last post by:
I've set a background image to repeat-y and at 100% height. It appears fine when I open the window, but when I resize to a smaller height so that I must scroll down to see the rest, the background...
1
by: crater | last post by:
I have a web form with several "submit" buttons. One of these uploads a file, and I want to validate the user input prior to submitting the form. I have an event handler specified with the...
7
by: Marcel Stör | last post by:
I want to overhaul http://www.s-tisch.ch/. The layout is fine IMHO and I need to keep it that way. The implementation, however, is totally ugly. I intend to replace all frames with a CSS-based...
3
by: Annette Block | last post by:
I'm rather new in JavaScript, but I have some experience in php. I learned it's rather easy to open a window of a specified size with JavaScript, that you need to specify the opened file, but I...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.