Why does Firefox return 0 as the value of $(window).height()

前端 未结 7 921
野性不改
野性不改 2021-01-04 12:41

It seems to me that Firefox ought to be better equipped to return the proper value when using $(window).height().

I am using jQuery 1.8.2. Is this a bug

7条回答
  •  情歌与酒
    2021-01-04 13:14

    I found the answer to this strange render of height by jquery in Firefox...

    I used class="no-js" in my html tag with doctype... when I removed this, FF calculated correctly... so I added this class with jquery like this $('html').addClass('no-js');

    now the calulated is same in all browsers..

提交回复
热议问题