yb wrote :
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 do what I need.
The javascript solution assigns a function to window.onresize that
sets the inline style, it works with one problem -- the handler only
gets called after the resizing stops,
That's by design. IE will fire the onresize event continuously.
Mozilla-based browsers will fire the onresize event once the mouse
cursor stops moving:
Bugzilla Bug 114649: Onresize events should fire while resizing the
window, not just when the mouse stops moving.
https://bugzilla.mozilla.org/show_bug.cgi?id=114649
and so there is noticeable lag
before it redraws.
It is not the function that is taking a long time to execute, its
appears to be firefox's handling. It doesn't call it as frequently as
I expected.
Is there another javascript method to accomplish this without the
extra lag?
Thank you
First please provide an url so that we can better understand what you
are trying to do and why. Otherwise, explain why the image dimensions
must relate to the size of the window. Second, there may be - I'm sure
- an alternative to what you are trying to do.
E.g.:
Just go to
http://www.gtalbot.org/
and then resize the window in IE7, Firefox 2, Opera 9, Konqueror 3.x,
etc.. The image will be resized accordingly and continuously along with
the browser window viewport: no javascript, no complicated CSS there.
Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages