Link to home
Start Free TrialLog in
Avatar of sre22
sre22

asked on

Background images

I currently have my site load a background image using this code:

<style type="text/css">
<!--
body
{
  background-position: top;
  background-repeat: no-repeat;
  background-image: url("../Images/Background.jpg");  /*default image background*/
}

-->
</style>

Is it possible to make this image stretch to the full size of users screen rather that it just being the normal pixel size?  
ASKER CERTIFIED SOLUTION
Avatar of NeoTek
NeoTek

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sre22
sre22

ASKER

Unfortunately it is an Intranet so you won't have access to it.  The backgrounds fit a 1024x768 resolution but when using a larger resolution the image does not fill the screen.  I tried using a repeating background but it doesn't look right because the image just looks tiled.
Avatar of sre22

ASKER

how do the other options work that you were talking about (frames etc..)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sre22

ASKER

Thanks..
oups,
sorry to desagree, but you can use a JavaScript to strech it.
thanks to Massimo Foti !


<script language="JavaScript">
function makeIm() {
NS4=(document.layers);
IE4=(document.all);
scaleWidth = true;
scaleHeight = true;
imSRC = "images/yourImage.jpg";
if (NS4) {
origWidth = innerWidth;
origHeight = innerHeight;}
function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight)
location.reload();}
if (NS4) onresize = reDo;
if (IE4) onresize = reDoIE;
function reDoIE(){
imBG.width = document.body.clientWidth;
imBG.height = document.body.clientHeight;}
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);}
makeIm();
</script>
It's doing exactly what I want/expect it to, but I'm getting an "object required" runtime error on the line: "winWid = (NS4) ? innerWidth : document.body.clientWidth;" I asked a developer who's better with JavaScript than i am if he'd take a look. He's questioning the imBG object and thinks I'm missing an include. Do you know what might be going on?
This script doesnt seem to run in navigator 7.1.  It works fin in IE6 though any suggestions??