i have a div that sits 100 pixels from the top and i want the div to be 4 pixels from the bottom of the browser. i have got some old java script that was written in the days of netscape 4 and ie 4 so it dose not work at all in firefox or the new IE. in fact it only works in safari & IE on the mac.
he is a working example of my page:
[url]http://www.thehopeandanchor.net/nypd/jstest2.htm
this is my style sheet:
[code=html]<style type=”text/css”>
<!–
div#picture_con_show_place {
position:absolute;
top: 100px;
left: 438px;
width:451px;
height:417px;
overflow: auto;
background-color:#999999;
}
–>
</style>
this is the code i use to initiate the resize:
[code=html]<body onresize=”resized()” onload=”resized()”>
my java script:
[code=php]<script language=”JavaScript” type=”text/JavaScript”>
<!–
function resized() {
var newheight;
if (document.layers) {
//netscape not tested
newheight = window.innerHeight – 100 – 4;
document.picture_con_show_place.height = newheight+”px”;
} else if (document.all) {
//mac IE and (not PC IE)
newheight = document.body.offsetHeight – 100 – 4;
picture_con_show_place.style.height = newheight+”px”;
} else {
//works for safari – same code as for netscape
newheight = window.innerHeight – 100 – 4;
picture_con_show_place.style.height = newheight+”px”;
}
}
//–>
</script>