开发者

I can't get the right window height for IE7

I think I've tried everything to get the right window height in IE7 but all in vain.

Is there 1 surefire way to get the right window(viewport) height in IE7 and the other (better) browsers?

I've t开发者_运维技巧ried:

window.innerHeight(), 
document.innerHeight()

Jquery:

$(window).height(), 
$('body').height(), 
$('body').css('height')

The website link


$(window).height();

Will return the proper viewport height on IE7 - it could be how you're using it. If you try the following:

alert($(window).height());

You'll see its working (just tested IE7). If that simple bit of code doesn't work for you, make sure the jQuery library is loading properly, and make sure that you're checking the height inside a document.ready block.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜