Drew
Drew

Reputation: 2663

Assign Window Height to Document Height

Any ideas as to how this is accomplished?

$(document).css('height', $(window).height())
$('body, html').height($(window).height())
alert('$(document).height(): ' + $(document).height() + "\n$('body').height(): " +   $('body').height() + "\n$('html').height(): " + $('html').height() + '\n$(window).height(): ' + $(window).height())

Upvotes: 0

Views: 125

Answers (3)

Alvin Wong
Alvin Wong

Reputation: 12410

Try this css:

body {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

Upvotes: 0

Esailija
Esailija

Reputation: 140210

$("html,body").css("height", screen.height);​

My fiddle

Upvotes: 2

Darcey
Darcey

Reputation: 1987

To get get screen width and height.

alert ("screen W = " + screen.width );
alert ("screen H = " + screen.height );

Upvotes: 1

Related Questions