PCHomepage
Programmer
I just removed the obsolete frames from one of my very old legacy Web sites (created in the mid-'90s) and have it up and running with iFrames but I am unable to remove the body scrolling and show only the vertical iFrame scrolling. Is there a way to do it?
My CSS includes:
. . . and the HTML, simplified for this posting (meta tags removed), is something like:
In case it helps, the included Javascript contains:
My CSS includes:
CSS:
html {
min-height: 100%;
padding-bottom: 1px;
}
body {
background-image: url('/images/systemimages/background.gif');
font-family: Tahoma, Verdana, Arial, Helvetica;
font-size: 13px;
overflow: hidden;
margin: 0;
}
iframe {
position: relative;
width: 100%;
}
iframe#main {
overflow-y: auto;
overflow: -moz-scrollbars-vertical;
}
. . . and the HTML, simplified for this posting (meta tags removed), is something like:
HTML:
<!DOCTYPE HTML>
<html>
<head>
<title>Site Name</title>
<script language="JavaScript" src="/functions/iframes.js"></script>
<script type="text/javascript">
window.onload = function () {
setIframeHeight(document.getElementById('main'));
};</script>
</head>
<body>
<iframe src="/php/logo.php" name="logo" frameborder="0" scrolling="no" hspace="0" vspace="0" height="120"></iframe>
<iframe src="/php/main.php" id="main" name="main" frameborder="0" scrolling="auto" hspace="0" vspace="0">
Please update your browser to view this and most other sites properly.
</iframe>
</body>
</html>
In case it helps, the included Javascript contains:
JavaScript:
function setIframeHeight(iframe) {
if (iframe) {
var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;
if (iframeWin.document.body) {
iframe.height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight;
}
}
};