简体   繁体   中英

Get innerHeight in IE

I want to get the inner Height in IE. My page content is long and browser has a scroll bar.

I got that using window.innerHeight .It worked on Firefox and Chrome but not on IE(tried on IE9)

Is there way to get it?

Refer the screenshot: http://i.stack.imgur.com/m50Mg.jpg

PS

My problem was another thing. My IE ran on QUIRKS mode .

Both $(window).height() and window.innerHeight work when IE runs on Standards mode.

document.documentElement.clientHeight;

或使用jQuery:

$(window).height();

你有没有尝试过 :

window.height();//jquery

Try the below example

$(document).height(); // Just returns the actual height of the conatiner

$(document).innerHeight(); // including padding but not border.

$(document).outerHeight(); // including padding and border. 

$(document).outerHeight(true);  // if wants margin height means Including margin, padding, border and height

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM