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

dealing with multiple onresize in IE

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


P: n/a
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

P: n/a
>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 discussion thread is closed

Replies have been disabled for this discussion.