Ello
Ello

Reputation: 23

IE trouble jquery height of iframe

i have the following line to control the height of an iframe from within its content:

$("#frame",top.document).height($("#frame",top.document).contents().find("html").height());

it works perfect until someone uses IE.. how can i get it to work with IE?

thanks in advance, Ello

found a solution:

var iFrame = parent.document.getElementById('frame');
newHeight = parseInt(iFrame.contentWindow.document.body.offsetHeight)+20;
$("#frame",top.document).height(newHeight);

Upvotes: 1

Views: 2150

Answers (1)

Ello
Ello

Reputation: 23

ok, tomas, her we go:

var iFrame = parent.document.getElementById('frame');
newHeight = parseInt(iFrame.contentWindow.document.body.offsetHeight)+20;
$("#frame",top.document).height(newHeight);

Upvotes: 1

Related Questions