关于如何实现这一点的任何想法?
$(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())
答案 0 :(得分:2)
$("html,body").css("height", screen.height);
答案 1 :(得分:1)
获取屏幕宽度和高度。
alert ("screen W = " + screen.width );
alert ("screen H = " + screen.height );
答案 2 :(得分:0)
试试这个css:
body {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
}