PDA

View Full Version : Resizing Background Image


willdrury
04-02-2006, 02:49 PM
Is it possible to make the page background image resize so it appears the same on all monitor sizes?

kate
04-06-2006, 06:28 PM
Hya,

Not sure if this may work or not, you may have found the solution by now for anyone else its a nice little script.

Here is a script that I wrote a while back to set a background based on the screen resolution (size has nothing to do with it)

<script language="javaScript" type="text/javascript">

var Pic = new Array()


Pic[0] = '1.gif' //640x480 or less
Pic[1] = '2.gif' //800x600
Pic[2] = '3.gif' //1024x768 or more

if(screen.width<=640)
{
document.body.background = Pic[0];
}
else if(screen.width==800)
{
document.body.background = Pic[1];
}
else
{
document.body.background = Pic[2];
}

</script>


From 'PYRO @ http://www.webdeveloper.com/forum/showthread.php?p=29858#post29858

K

:D