Here is a script that will help you make a scrollbar free iframe:
function setHeight(ele) {
saveele = ele;
var oDoc = (ele.contentWindow || ele.contentDocument);
if (oDoc.document) oDoc = oDoc.document;
var D = oDoc;
h = Math.max(
Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
Math.max(D.body.clientHeight, D.documentElement.clientHeight)
);
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
if(is_chrome) {
h = oDoc.height;
}
ele.height = h;
}
Here is a working example.
I hope it helps :)
0 Comments:
Post a Comment