Bug Tracker

Ticket #2894 (new bug)

Opened 8 months ago

Last modified 8 months ago

.width() .height() don't work correctly in iframes

Reported by: boemer Assigned to: brandon
Type: bug Priority: major
Milestone: 1.2.4 Component: dimensions
Version: 1.2.3 Keywords:
Cc: Needs: Review

Description

[first]

I'm doing the following: $(document).width(); Where document, is inside an iframe.

In Firefox, Safari, Opera it returns the correct width (the same value as window.innerWidth;

In IE it returns me the total clientWidth of the main window. Not the width of the iframe (the iframe has a left of 130px for example).

[second]

I'm doing the following: $(document).height();

In Firefox, Safari it gives me the correct height of the iframe.

In Opera it returns a small number, where window.innerHeight returns the correct value.

In IE document.body.clientHeight returns the wrong number, but $(document).height() returns the whole window height, not the iframe height.

Attachments

Change History

Changed 8 months ago by boemer

Okay found the problem with IE, seems to be a bug in my design and not jquery.

The Problem with Opera stays:

$(document).height() returns a wrong value in Opera, where window.innerHeight returns the correct value.

Note: See TracTickets for help on using tickets.