473,320 Members | 1,958 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,320 software developers and data experts.

dealing with multiple onresize in IE

I have a script that is called by the window.onresize event. The
problem is that the script is called multiple times when I'm resizing
the window in IE - obviously, because IE continuously fires the
onresize event while it is being resized.

What I'm wondering is - does anyone have any suggestions on making the
script function only once, after the last onresize event, rather than
on every one?

I've done some searching, but I'm not getting much - probably because
I'm having trouble finding a good phrasing for the search.

Any help of suggestions would be appreciated.

Thx!

Dec 6 '05 #1
2 3807
On 6 Dec 2005 12:07:06 -0800, "Tony" <to****@dslextreme.com> wrote:
I have a script that is called by the window.onresize event. The
problem is that the script is called multiple times when I'm resizing
the window in IE - obviously, because IE continuously fires the
onresize event while it is being resized.
This is actually a windows window manager configuration option, and
for me other UA's should follow the convention of the WM, of course
they think they know better how a UI should work than how the user's
configured it...
What I'm wondering is - does anyone have any suggestions on making the
script function only once, after the last onresize event, rather than
on every one?

clearTimeout(timer)
timer=setTimeout(dosomething,500);

that will perform the action 500ms after the last firing... adjust as
necessary.

Jim.
Dec 6 '05 #2
>clearTimeout(timer)
timer=setTimeout(dosomething,500);

that will perform the action 500ms after the last firing... adjust as
necessary.


Ah- I had forgotten about clearTimeout - thanks!

Dec 7 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bas | last post by:
Hello all, I'm trying to create a little script which will save the width of a certain frame into a database, so that every user still has his/her "own" frame width when logging back on. Now,...
4
by: Ike | last post by:
Does javascript have on onresize() method? How can you implement that? Is it possible to cause things to repaint when resized? Thanks, Ike
2
by: David | last post by:
Greetings, Does anyone know of a workaround for the onresize bug in Firefox? <body onresize="history.go(0)"> I've looked all around and can't seem to find a working workaround. David
1
by: Darrel Yurychuk | last post by:
I'm having a problem getting the window.onresize to work properly. Here is a simple test case I wrote: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">...
2
by: Tony | last post by:
If I want to call a function (call it doResize) when the browser window is resized, is it better to put that in the body tag: <body onresize="doResize()"> Or is it better to put the call in a...
2
by: FrankIsHere | last post by:
This should attach the event to the onresize of the window object, but when I try to resize the browser after executing the page it does not work... only after I refresh the page. But then of...
8
by: David Gravereaux | last post by:
Hi, I'm using chunked transfer-coding to send an "unending" page, but IE _NEVER_ fires onresize events until the page is finished. Unfortunately, the page never is "finished". How do I handle...
4
by: jayscott1 | last post by:
What I would like to do is have the user start typing in the last name and as they were typing it would retrieve names from the database and give a drop down like autosuggest in google. That much...
2
by: yb | last post by:
I am attempting to modify the style of an element (its width) as the window is being resized, in firefox. Long story short, I've tried to use CSS but one particular part of the layout just won't...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.