Connecting Tech Pros Worldwide Help | Site Map

dealing with multiple onresize in IE

 
LinkBack Thread Tools Search this Thread
  #1  
Old December 6th, 2005, 07:15 PM
Tony
Guest
 
Posts: n/a
Default 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!


  #2  
Old December 6th, 2005, 07:35 PM
Jim Ley
Guest
 
Posts: n/a
Default Re: dealing with multiple onresize in IE

On 6 Dec 2005 12:07:06 -0800, "Tony" <tony23@dslextreme.com> wrote:
[color=blue]
>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.[/color]

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...
[color=blue]
>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?[/color]


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

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

Jim.
  #3  
Old December 7th, 2005, 05:05 PM
Tony
Guest
 
Posts: n/a
Default Re: dealing with multiple onresize in IE

>clearTimeout(timer)[color=blue]
>timer=setTimeout(dosomething,500);
>
>that will perform the action 500ms after the last firing... adjust as
>necessary.[/color]

Ah- I had forgotten about clearTimeout - thanks!

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.