JavaScript On Browser Resize

css, javascript, jquery

Solution

Yep, it's possible - just add the `resize` event handler like this:

$(window).resize(function() {
    $('#body').css('min-height', $(window).height() - $('#title').height() - 220);
});

Problem

I have 2 elements on a page, a title and content area for people to enter text. The contents height is determined using JavaScript: ``` $('#body').css('min-height', $(window).height() - $('#title').height() - 220); ``` Is there a way I can have it so when the window is resized, the #body changes its height?

Original source

Related problems