Skip to main content

Bug Tracker

Side navigation

#7427 closed bug (worksforme)

Opened November 07, 2010 01:48PM UTC

Closed November 07, 2010 03:03PM UTC

Last modified March 13, 2012 07:13PM UTC

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:
Description

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">
    <head>
        <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">
            <![CDATA[
                $(document).ready(function() {
                   $("#produce").click(function() {
                       $("#filler").css("display", "block");
                       showViewportDimensions();
                   });

                   showViewportDimensions();
                });

                function showViewportDimensions() {
                    $("#result").text("Viewport width: " + $(window).width() + "; height: " + $(window).height());
                }
            ]]>
        </script>
    </head>
    <body>
        <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>
    </body>
</html>

Attachments (0)
Change History (1)

Changed November 07, 2010 03:03PM UTC by rwaldron comment:1

component: unfileddimensions
priority: undecidedlow
resolution: → worksforme
status: newclosed

This bug does not exist with jQuery 1.4.4rc2

http://jsfiddle.net/rwaldron/ryUuN/1/