0

I'm trying to show an Iframe with only a specific div from a page. I've seen some topics about that, but each of them considers that we know the size of the div, and restricts the Iframe dimensions to the size of the div and prevent scrolling. In my case, I want to restrict the portal to a specific div which can evolve in the future and have a different size. I've seen topics which use page anchors, with this kind of iframe tag :

<iframe title="Title" ng-src="http://www.exemple.com#anchor"></iframe>

I've tried this but it seems not to care and still display the whole page. the only things I know about the div are its id, its classes. It contains a variable number of other divs.

Is there a way to have an Iframe which adapts to the div size in any case? By the way I have strict rules on my project, so no jquery, only angular as far as it is possible.

Thank you.

Djbapt
  • 21
  • 4
  • Possible duplicate of [make iframe height dynamic based on content inside- JQUERY/Javascript](https://stackoverflow.com/questions/9162933/make-iframe-height-dynamic-based-on-content-inside-jquery-javascript) – Niko Chaffin Jan 23 '18 at 17:06
  • You can not control anything inside an iframe that is from different origin due to *"same origin policy"* – charlietfl Jan 23 '18 at 17:07
  • As I said, no Jquery if possible :( And it's for a whole page on the link you gave. – Djbapt Jan 23 '18 at 17:07
  • Does it have to be an iframe? If it is just for display and isn't interactive there is a possibility that you could make an ajax call to the page and then load that div into your page. – JasonB Jan 23 '18 at 18:41

0 Answers0