Mateo Suarez
Mateo Suarez

Reputation: 29

Auto adjust height of a div

I want to make a div with the height of the window but can the height be auto-upgradeable?

$(document).ready(function() {

    var hpd = $(document).height();
    var hph = $(".header").height();

    $('.wrapper').css({height: hpd })
    $('.contenido').css({height: hpd-hph-1 })

});

Upvotes: 0

Views: 129

Answers (1)

Stefan van de Laarschot
Stefan van de Laarschot

Reputation: 2163

Try this

$(document).ready(function(){
   $(window).resize(function(){
            $(".example").height ($(this).height());
     });
});

Upvotes: 3

Related Questions