I have a page that has a fairly complicated layout. When the page is initially opened there\'s a problem with the aligment of some of the elements. However, this problem can be
There's an window.onresize event that fires when the window is resized. You can force a resize by changing the window.width or height by a pixel and then setting it back on a small timer.
With jQuery you can do something like this:
$(function() {
$(window).width($(window).width() + 1);
// delay so DOM can update and not batch UI updates
setTimeout(function() { $(window).width($(window).width() -1); },3);
});
FWIW, I've seen this myself before, but I agree with @bouke that you should defintitely try to identify what's causing the broken layout. I find it usually has to do with floated content or overflow of text containers that causes these sorts of problems.