I've an iframe thats loaded with content from same domain. I have a inline style for iframe as width: 100%;
I try to get the content width of the iframe as:
document.getElementById('i
frame').Do
cument.bod
y.offsetWi
dth or scrollWidth - these properties always give me the screen width due to the style (100% width) I gave.
If I remove width=100% inline style, these properties give me actual content width but the problem is during loading the data in iframe, it displays a cut-off content and once the body is loaded completely shows up the whole screen.. any tips?
Start Free Trial