0

关于如何实现的任何想法?

$(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())
4

3 回答 3

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

我的小提琴

于 2012-07-22T12:26:23.230 回答
1

获取屏幕宽度和高度。

alert ("screen W = " + screen.width );
alert ("screen H = " + screen.height );
于 2012-07-22T12:29:01.137 回答
0

试试这个CSS:

body {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}
于 2012-07-22T13:42:49.453 回答