Below jquery code will help you to generate dynamic height without scroll bar in iframe and also you can change src url dynamically.
Hope this will help :)
Cheers
$(document)
.ready(
function() {
var newurl = 'any_url';
$('#iframe_id').attr('src', newurl);
// For other good browsers.
$('iframe')
.load(
function() {
this.style.height = 0;
this.style.height = this.contentWindow.document.body.scrollHeight
+ 500 + 'px';
// this.style.width =
// this.contentWindow.document.body.offsetWidth
// + 100 + 'px';
});
});
Hope this will help :)
Cheers
No comments:
Post a Comment