在jquery中希望通过innerwidth来获取窗口的宽度,于是这样写的

var leftinfo = $(window).get(0).innerWidth,但是在ie8中却提示NaN,在ie9中却能正常使用。具体原因不知道为什么。

于是我转向使用width()这个方法。

varleftinfo=$(window).width()-$("#rightinfo").outerWidth()-10;$("#leftinfo").css("width",leftinfo);$("#rightinfo").css("display","block");$("#dyframe").attr("src","http://www.akcms.com/dfasdf");$(window).resize(function(){$("#leftinfo").css("width",$(window).width()-$("#rightinfo").outerWidth()-10);});