Bug Tracker


Ticket #7427 (closed bug: worksforme)

Opened 3 years ago

Last modified 2 years ago

chrome viewport height changes depending on document length

Reported by: anonymous Owned by:
Priority: low Milestone: 1.5
Component: dimensions Version: 1.4.3
Keywords: Cc:
Blocking: Blocked by:


Google Chrome: 7.0.517.44 jQuery: 1.4.2 Ubuntu: 10.4

The viewport height changes depending on the document length. The width stays the same (or changes because of the scrollbar that appears).

Viewport size is read using $(window).height().

See this example

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
        <meta http-equiv="Content-Type" content="application/xhtml+xml;charset=utf-8" />

        <script type="text/javascript" src="resources/js/jquery-1.4.2.min.js"></script>

        <script type="text/javascript">
                $(document).ready(function() {
                   $("#produce").click(function() {
                       $("#filler").css("display", "block");


                function showViewportDimensions() {
                    $("#result").text("Viewport width: " + $(window).width() + "; height: " + $(window).height());
        <h1>jQuery / Chrome viewport bug</h1>
        <p id="result"></p>
        <p id="produce" style="color: red;">Produce bug</p>
        <p id="filler" style="padding: 400px 0; display: none;"></p>

Change History

comment:1 Changed 3 years ago by rwaldron

  • Priority changed from undecided to low
  • Resolution set to worksforme
  • Status changed from new to closed
  • Component changed from unfiled to dimensions

This bug does not exist with jQuery 1.4.4rc2


Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


Add a comment

Modify Ticket

as closed

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.