D
David Mark
Sorry for bumping such an old thread, just found this group.
If you want to do this via JS & CSS and (like me) you never know what
the
height of a completed dynamic page will be, then this is the way for
you. This
also handles if the body is smaller than the window, or larger to make
sure
that whichever is larger is completely filled.
The example below puts the color red over the entire page or viewport,
whichever is larger:
<script>
Oops. What type of script?
function test()
{
var bodies = document.getElementsByTagName('BODY');
No test for this method? Not even an attempt at document.body?
var body = bodies[0];
var newNode = document.createElement('DIV');
var ht = getWindowHeight();
Oh yeah, that global method.
if (document.body.offsetHeight > ht)
Oh brother.
ht = document.body.offsetHeight;
Appalling. Two in one day using document.body.offset* to measure the
viewport. See the FAQ.
var wd = getWindowWidth();
See above.
if (document.body.offsetWidth > wd)
ht = document.body.offsetWidth;
Same.
newNode.style.height = ht + 'px';
newNode.style.width = wd + 'px';
newNode.style.backgroundColor = 'red';
newNode.style.position = 'absolute';
newNode.style.top = '0px';
Don't need units for 0.
newNode.style.left = '0px';
newNode.style.zIndex = '10000';
newNode.innerHTML = ' '
body.appendChild(newNode);}
</script>
If you need more help, you may ping me at www dot perkiset dot
org/forum/
*** Sent via Developersdexhttp://www.developersdex.com***
I knew it.