开发者

$(window).height(): Firefox "loading-bar" in footer blocks 17px

I use jquery $(window).height() to get the height of th开发者_开发百科e viewport. But the result is 17px smaller than expected. It seems the litte "loading-bar" with the infomation about the site (at the bottom left side) blocks the "last 17px" in Firefox 5 and also in Safari. So the height of the viewport ist smaller than it really is.

I'm using Jquery 1.6.2

Anybody see the same issue?


I just figuered out, that my Image hasn't got a width and height, so with js turned off, there shows up a scroll bar at the bottom, which is as high as the information/status bar of the browser. Because I read the height/width on domready, the window.height() just get the size of the viewport as it is without JS and there "it" finds a scrollbar at the bottom.

Now I fixed it, by giving the element a width and height, that causes the scrollbar , so there is nolonger a scrollbar. After that, the window.height() shows the right and expected size.

thx for help, and what ive learned? understand the Domready, and sometimes i have to turn of JS to get rid of errors, that seems to be caused by JS, but aren't.


That's not an "issue". The information bar takes up space, therefore the $(window).height() is logically going to be a certain number of pixels smaller than if the bar were hidden.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜