| 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. |