I have a scenario where i need to detect when the content area of the browser changes size. Now, normally one would just attach to the window's resize event and be done with it. But, this does not work when something on the page causes a scrollbar to appear. The window never raises and event since the window did not change size, just its content did to make room for the scrollbar. So, my next attempt was to hook into the body resize like this:
$("body").resize(function(){alert("resized!")); But unfortunately this never fires in any browser other than IE (for once it does something I want it to). Does anyone have an elegant solution to this? All i need to do is detect that a scrollbar has appeared and my page width has changed because of it. I need to do this since I am absolutely positioning an element next to an inline element and I need to keep it in the correct position even when a scrollbar appears or the window is resized.