Jquery: IE window width
my computer screen width is 1280 but why IE says it's 1259 but other b开发者_如何学Gorowsers say 1280 with widht();?
$(document).ready(function(){
alert($(window).width());
});
can it be fixed for IE?? have a look here,
http://ec-ener.eu/dump/index3.php
Thank, Lau
window.width()
doesn't give you the screen's width, but the current window's.
IE will always show a disabled scroll bar to the right of your document, even when it's not needed.
I assume it's that width that gets subtracted in IE.
Try using screen.availWidth
to get the full screen width.
Use $(document).width()
I had the same problem as you!
I found that using
var height = window.innerHeight || $(window).height();
var width = window.innerWidth || $(window).width();
will give the same value both in chrome and IE
精彩评论