[thelist] Centering in IE6?

david lloyd parker david at image2image.co.uk
Thu Mar 21 01:34:10 CST 2002


I read this thread with interest, as I've been trying to effect a solid
colour margin on the left of a non-framed page that always fits the height,
whatever the window size, and without displaying a scroll bar. I came up
with the following, which works reasonably well across browsers (that have
JS turned on of course), but I don't know what traps I'm falling into with
it. In the body tag I use onResize="location.href = location.href", to trap
resize of the browser. The code needless to say sits inside a TD.

<script language="JavaScript">
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
ns6 = (document.getElementById)? true:false
if (ns4||ie4)
winH = (ns4)? window.innerHeight : document.body.offsetHeight
else
winH = window.innerHeight
document.write('<img src="images/spacer.gif" width="1" height="' +
(winH-525) + '">');
</script>

Please DO shout at me if this is absolute crap!




More information about the thelist mailing list