Thread: Backround image
View Single Post
Old 07-02-2002, 05:27 PM   PM User | #5
Quiet Storm
Regular Coder

 
Join Date: Jun 2002
Location: Beyond Lament
Posts: 424
Thanks: 0
Thanked 0 Times in 0 Posts
Quiet Storm is an unknown quantity at this point
For all your background sizing problems...

Use this code:

<HEAD>


<SCRIPT>
NS4 = (document.layers);
IE4 = (document.all);
scaleWidth = true;
scaleHeight = true;
imSRC = "
your-image.jpg";
if (NS4) window.onload = setResize;
function setResize(){
setTimeout("window.onresize=reDo;",500);
}
function reDo(){
window.location.reload()
}
if (IE4) window.onresize = reDoIE;
function reDoIE(){
imBG.width = document.body.clientWidth;
imBG.height = document.body.clientHeight;
}
function makeIm() {
winWid = (NS4) ? innerWidth : document.body.clientWidth;
winHgt = (NS4) ? innerHeight : document.body.clientHeight;
imStr = "<DIV ID=elBGim"
+ " STYLE='position:absolute;left:0;top:0;z-index:-1'>"
+ "<IMG NAME='imBG' BORDER=0 SRC=" + imSRC;
if (scaleWidth) imStr += " WIDTH=" + winWid;
if (scaleHeight) imStr += " HEIGHT=" + winHgt;
imStr += "></DIV>";
document.write(imStr);
}
</SCRIPT>


</HEAD>
<BODY>

<SCRIPT LANGUAGE="JavaScript1.2">
makeIm();
</SCRIPT>


... the rest of your content...


</BODY>
__________________
Quíet Storm Designs ~ Art is not what you see, but what you make others see.
· the Storms· || ·Ultraviolent Winter· || ·Was Einstein Wrong?· || ·It´s About Time!·
Quiet Storm is offline   Reply With Quote