<scripttype="text/javascript">
function SetCwinHeight() {
var iframeid = document.getElementById("center"); //iframe id
iframeid.height = "0px";//先给一个够小的初值,然后再长高.
if (document.getElementById) {
if (iframeid && !window.opera) {
if (iframeid.contentDocument && iframeid.contentDocument.body.offsetHeight) {
iframeid.height = iframeid.contentDocument.body.offsetHeight;
} else if (iframeid.Document && iframeid.Document.body.scrollHeight) {
iframeid.height = iframeid.Document.body.scrollHeight;
}
}
}
</script>
<iframeid="center"name="center"src="Center.jsp"
scrolling="no"frameborder="no"allowtransparency="yes"border="0"marginwidth="0"marginheight="0"
οnlοad="Javascript:SetCwinHeight()"
width="100%"></iframe>
function SetCwinHeight() {
var iframeid = document.getElementById("center"); //iframe id
iframeid.height = "0px";//先给一个够小的初值,然后再长高.
if (document.getElementById) {
if (iframeid && !window.opera) {
if (iframeid.contentDocument && iframeid.contentDocument.body.offsetHeight) {
iframeid.height = iframeid.contentDocument.body.offsetHeight;
} else if (iframeid.Document && iframeid.Document.body.scrollHeight) {
iframeid.height = iframeid.Document.body.scrollHeight;
}
}
}
</script>
<iframeid="center"name="center"src="Center.jsp"
scrolling="no"frameborder="no"allowtransparency="yes"border="0"marginwidth="0"marginheight="0"
οnlοad="Javascript:SetCwinHeight()"
width="100%"></iframe>
来源:http://www.xymyeah.com/?p=40