shah
shah

Reputation: 21

Iframe height issue

I have an iframe loaded with dynamic datas. The page doesn't contains a postback. While deleting datas from this page its heights are not decreasing.

Why is it so?

Upvotes: 2

Views: 311

Answers (2)

Kronass
Kronass

Reputation: 5406

If you mean that if you removed data from Iframe, the Iframe is not dynamically resizing it self to fit to content inside like span or div tags (if div size was not set). if that so. sorry Iframe doesn't work like this. it is inner page and its size is fixed and you must use Javascript if you want to give dynamic resizing.

that's how I understood it. clarify me if I miss understood

Upvotes: 1

Dustin Laine
Dustin Laine

Reputation: 38503

Because the page is net being rendered again. Use JavaScript to decrease the height after data is removed.

Something like (untested):

parent.window.document.getElementById("<FRAME_NAME>").height = parent.window.document.getElementById("<FRAME_NAME>").height - 30;

Upvotes: 1

Related Questions