jquery to solve the 100% height problem

January 12th, 2010

Real short post today just a quick snippet of jQuery that solves the 100% height problem.

Yes there are complete CSS solutions to this but it seems that at times they can be problematic, and at other times laziness can kick in.

$(document).ready(function () {
    $("#divID").height($(document).height());
});

//And the slightly more fancy way. With a subtle slide down.

$(document).ready(function () {
    $("#divID").animate({ height: $(document).height() }, 500 );
});

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>