Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iframe height adjustment [duplicate]

Is there a way to set the height of the iframe to be the same as the height of its source?

I am trying to
a) Avoid scrollbars and
b) Avoid using fixed height in px

Thank you. :)

like image 959
johnjohn Avatar asked Dec 31 '25 04:12

johnjohn


1 Answers

Since the source page is on a different domain — no.

The only way to adjust its size based on the content is to measure the rendered size of the content using JavaScript, and the Same Origin Policy will prevent this.

like image 72
Quentin Avatar answered Jan 05 '26 00:01

Quentin