Is there a way to adjust the size of an iframe based on its content?
Below is the HTML code I am using:
<body>
<iframe id="test" src="http://www.bbc.co.uk/urdu/"></iframe>
</body>
And here is the jQuery code I have implemented:
$(document).ready(function () {
setInterval(function () {
stretchHeight();
}, 5000);
function stretchHeight() {
$("#test").height($("#test").contents().find("html").height());
}
});
I have attempted to do this without using an interval, but it still did not work. Can someone please offer assistance? Thank you in advance!