I have a div on my website that should be the height of the window. This is what i got:
$(document).ready(function() {
var bodyheight = $(document).height();
$("#sidebar").height(bodyheight);
});
However, it does not automatically change when the window is resized? Does any body know how to fix this?
Thanks
You also need to do that in resize
event, try this:
$(document).ready(function() {
$(window).resize(function() {
var bodyheight = $(this).height();
$("#sidebar").height(bodyheight);
}).resize();
});