Lid |
|
ik heb hier wel een bestandje waarin erin er een vaste footer word gebruikt maar dit is dan wel met javascript.
als dat je kan helpen?
<html>
<head>
<title></title>
<style type="text/css">
body {
margin: 0;
padding: 0;
font: 12px/1.5 verdana, arial, helvetica, sans-serif;
overflow:hidden;
}
#content {
padding: 10px;
background-color: #ccc;
height:400px;
overflow:auto;
}
#footer {
position: relative; /* nodig voor Safari */
padding: 10px;
background-color: #ddd;
}
</style>
<script type="text/javascript">
function getWindowHeight() {
var windowHeight = 0;
if (typeof(window.innerHeight) == 'number') {
windowHeight = window.innerHeight;
}
else {
if (document.documentElement && document.documentElement.clientHeight) {
windowHeight = document.documentElement.clientHeight;
}
else {
if (document.body && document.body.clientHeight) {
windowHeight = document.body.clientHeight;
}
}
}
return windowHeight;
}
function setFooter() {
if (document.getElementById) {
var windowHeight = getWindowHeight();
if (windowHeight > 0) {
var contentHeight = document.getElementById('content').offsetHeight;
var footerElement = document.getElementById('footer');
var footerHeight = footerElement.offsetHeight;
if (windowHeight - (contentHeight + footerHeight) >= 0) {
footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
}
else {
footerElement.style.top = '0px';
}
}
}
}
window.onload = function() {
setFooter();
}
window.onresize = function() {
setFooter();
}
</script>
</head>
<body>
<div id="content">
inhoud van webpagina
</div>
<div id="footer">Footer</div>
</body>
</html>
<html> <head> <title></title> <style type="text/css"> body { margin: 0; padding: 0; font: 12px/1.5 verdana, arial, helvetica, sans-serif; overflow:hidden; } #content { padding: 10px; background-color: #ccc; height:400px; overflow:auto; } #footer { position: relative; /* nodig voor Safari */ padding: 10px; background-color: #ddd; } </style> <script type="text/javascript"> function getWindowHeight() { var windowHeight = 0; if (typeof(window.innerHeight) == 'number') { windowHeight = window.innerHeight; } else { if (document.documentElement && document.documentElement.clientHeight) { windowHeight = document.documentElement.clientHeight; } else { if (document.body && document.body.clientHeight) { windowHeight = document.body.clientHeight; } } } return windowHeight; } function setFooter() { if (document.getElementById) { var windowHeight = getWindowHeight(); if (windowHeight > 0) { var contentHeight = document.getElementById('content').offsetHeight; var footerElement = document.getElementById('footer'); var footerHeight = footerElement.offsetHeight; if (windowHeight - (contentHeight + footerHeight) >= 0) { footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px'; } else { footerElement.style.top = '0px'; } } } } window.onload = function() { setFooter(); } window.onresize = function() { setFooter(); } </script> </head> <body> <div id="content"> inhoud van webpagina </div> <div id="footer">Footer</div> </body> </html>
|