window.onresize slow (firefox)

Y

yb

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, 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
 
E

Evertjan.

yb wrote on 19 mrt 2007 in comp.lang.javascript:
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, 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.

why would you want it to be done so frequently?
Is there another javascript method to accomplish this without the
extra lag?

Show your code, only the working relevant part please.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top