Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#7427 closed bug (worksforme)

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:
Blocked by: Blocking:


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 (1)

comment:1 Changed 12 years ago by Rick Waldron

Component: unfileddimensions
Priority: undecidedlow
Resolution: worksforme
Status: newclosed

This bug does not exist with jQuery 1.4.4rc2


Note: See TracTickets for help on using tickets.