Bug Tracker

Opened 11 years ago

Closed 11 years ago

#12845 closed bug (duplicate)

$(window).height() do not return the right window size

Reported by: Madef Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:



jQuery 1.8.2 have a small bug with viewport size ($(window).height()). The height returned is the one of the document. I do not reproduced the problem with 1.4.2, I did not try with other version. I reproduce the problem on chrome and firefox.

Please to reproduce the problem try this code and on the browser console try :$(window).height().

			.floating {
				margin: 5px;
				float: left;
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
		<a href="#" class="floating">
			<img src="http://jquery.org/wp-content/uploads/2010/01/JQuery_logo_color_onwhite-300x74.png" />
		<a href="#" class="floating">
			<img src="http://jquery.org/wp-content/uploads/2010/01/JQuery_logo_color_onwhite-300x74.png" />
                <!-- copy the link many times -->

To fix my problem I used "document.body.clientHeight" which give the correct size of the viewport.

Best regards,

Change History (1)

comment:1 Changed 11 years ago by mikesherov

Resolution: duplicate
Status: newclosed

Duplicate of #12284.

Note: See TracTickets for help on using tickets.