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

前端 未结 7 917
野性不改
野性不改 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:21

    Try the following code:

    $(function(){
      $(window).on('cwsObjectsShown', function() {
        alert($(this).height());
      });   
    });
    

提交回复
热议问题