i am not saying its difficult but i would like to know what way is used professionally.
what i do is declare iframes from html code and assign a scr to it,
but the problems are
switching the html code each time for declaration
the size of frame does not change/ adjust with the page in it, scroll bars do appear but thats not it
so any advice
Use the onload on your iframe and recalculate/set the new width and height on your iframe.
The onload is fired when new content has been loaded inside the iframe.
Some similar: Dynamically resizing navigation div to main content
On the internet you can find some example how you can get the internal width.
Here is one…
http://www.infoqu.com/dev/javascript-development/getting-iframe-width-194102-1/