try this
<div id="ifrm" >
<iframe name="ttframe"
id="ttframe"
src="Put your source here"
scrolling="no"
marginwidth="0"
marginheight="0"
frameborder="0"
width=100%
height=0
style="position:relative; left:0px; top:0px;">
</iframe>
</div>
One of the issues with
iframe
is that you can not set a height in terms of percentage. So, either you need to try it set it in css ( I am not sure if that is possible ) or you need to adjust it using JavaScript as shown.
$(function () {
if ($.browser.safari || $.browser.opera) {
$("#ttframe").load(function () {
setTimeout(resizeAllIFrames, 0);
}
);
}
else {
resizeIFrame();
$("#ttframe").load(resizeIFrame);
}
});
function resizeIFrame() {
if ($.browser.safari || $.browser.opera) {
}
else {
var ttfrm = $("#ttframe");
var innerDoc = (ttfrm.get(0).contentDocument) ?
ttfrm.get(0).contentDocument :
ttfrm.get(0).contentWindow.document;
ttfrm.height(innerDoc.body.scrollHeight + 35);
}
location.href = "#";
}
function resizeAllIFrames() {
var ttfrm = $("#ttframe");
var innerDoc = (ttfrm.get(0).contentDocument) ?
ttfrm.get(0).contentDocument :
ttfrm.get(0).contentWindow.document;
ttfrm.height(innerDoc.body.scrollHeight + 35);
location.href = "#";
}