$(window).resize(foo())
to detect when the window is resizeing…
the foo() works fine but it only fires foo() after the resize has finished so it’s not while resizeing.
is there a way to make the resize smoothly. maybe a cancelBubble could be something to do with it but im not familiar with it.
You can’t do precisely what you want by listening to window
resizeevents.Check out Google maps or reader, try resizing the window vertically. Note that these apps exhibit the same behavior.
Look a bit more carefully at your CSS. I find that sometimes CSS can do some very surprising things. If you post some sample HTML and CSS that is representative of you problem, we may be able to devise a solution.
If you absolutely cannot tolerate waiting until the user has finished resizing the window, you could poll
document.scrollWidthanddocument.scrollHeightat a short interval. Whenever they change, call your resizing code. Note that polling these properties may be pretty expensive. I recommend against this, but it will solve the problem.If you are using Internet Explorer, depending on version, you made need to use
document.documentElement.scrollWidthordocument.body.scrollWidth(and similar forscrollWidth).Firefox 3.6 will support events for determining when
document.scrollWidthanddocument.scrollHeightchange, although it looks like it will be non-standard:https://developer.mozilla.org/en/DOM/Detecting_document_width_and_height_changes