Bug Tracker

Opened 15 years ago

Closed 14 years ago

Last modified 11 years ago

#2894 closed bug (fixed)

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

Reported by: boemer Owned by: brandon
Priority: major Milestone: 1.2.4
Component: dimensions Version: 1.2.3
Keywords: Cc:
Blocked by: Blocking:



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).


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.

Change History (2)

comment:1 Changed 15 years 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.

comment:2 Changed 14 years ago by brandon

Resolution: fixed
Status: newclosed

This is working for me in latest SVN build of jQuery

Note: See TracTickets for help on using tickets.