Tom Auger
Tom Auger

Reputation: 20066

How can I intercept Google Chrome's resize() event prior to its native paint?

In situations where you are changing the position of some on-page element in response to a resize() event (for example, to emulate a min-width type situation), Firefox patiently waits for your event handler to complete before repainting the window. Chrome, on the other hand, paints first, then processes your event handler, then re-paints if it has to.

In Chrome the result is a significant "bounce" or flicker as the element being repositioned is first drawn at its new location (based on its original location +/- the new window dimensions) and then redrawn at its re-calculated location (based on your event handler's instructions).

I need a way to either get my event handler in earlier, or force Chrome to not re-paint until I tell it to.

Note that this is not a debounce/throttle issue. That would, in fact, make this issue even more noticeable!

Upvotes: 1

Views: 192

Answers (0)

Related Questions