Computer Science Books @ Amazon.com

‘); doc.close(); } } this.iframeload = function () { var iframe = document.getElementById(iframeId); iframe.style.display = ”; setTimeout(function () { setIframeHeight(initialResizeCallback); }, 20); } function getDocHeight(doc) { var contentDiv = doc.getElementById(“iframeContent”); var docHeight = 0; if(contentDiv){ docHeight = Math.max( contentDiv.scrollHeight, contentDiv.offsetHeight, contentDiv.clientHeight ); } return docHeight; } function setIframeHeight(resizeCallback) { var iframeDoc, iframe = document.getElementById(iframeId); iframeDoc = ((iframe.contentWindow && iframe.contentWindow.document) || iframe.contentDocument); if (iframeDoc) { var h = getDocHeight(iframeDoc); if (h && h != 0) { iframe.style.height = parseInt(h) + ‘px’; if(typeof resizeCallback == “function”) { resizeCallback(iframeId); } } else if (nTries < MAX_TRIES) { nTries++; setTimeout(function () { setIframeHeight(resizeCallback); }, 50); } } } this.resizeIframe = function(resizeCallback) { nTries = 0; setIframeHeight(resizeCallback); } } return DynamicIframe; });

Source

Leave a Reply