Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#13443 closed bug (duplicate)

Height of window reported incorrectly

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:


Good day. I have downloaded the latest version of jquery (1.9.1) and noticed a problem about the height of the window. In my script I have alert($(window).height()) and it constantly reports 211, no matter how smaller or larger i make it. The strange thing is that yesterday was working correctly. Today, all of the sudden is not. To test my code, I have downgraded from 1.9.1 to 1.6.3 (1.8 still had the problem) and alert($(window).height()) now reports correctly. Please fix it.

Change History (3)

comment:1 Changed 10 years ago by [email protected]

I've also noticed this issue. I've tested it on Chrome (Mac) and Firefox (Mac) against every release version of JQuery in the google cdn. Here is what I found:

JQuery 1.8.0 - 1.9.1 incorrectly report the document height instead of the viewport height when calling $(window).height()

See the Error Here: http://jsbin.com/ifipoq/1/edit

comment:2 Changed 10 years ago by dmethvin

Resolution: duplicate
Status: newclosed

Duplicate of #12388.
Annnnd, you're in quirks mode.

comment:3 Changed 10 years ago by [email protected]

If you're looking at this in JSBin, document.compatMode is reported incorrectly. The following does not trigger quirks mode, and does cause the problem in at least Chrome 24.0.1312.57:

<!DOCTYPE html>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
  $(function() {
<meta charset=utf-8 />
<title>JS Bin</title>
    <li>Mode: <span id='mode'></span></li>
    <li>Pre: <span id='height'></span></li>
Note: See TracTickets for help on using tickets.