Posted by Tim Drozinski on August 07, 1998 at 15:20:30:
In Reply to: Background image posted by Ed W on August 06, 1998 at 15:18:47:
: I have a page with one big background image. Is it possible to change the height and width of the background image with the height and width of the window so the page will always look right?
You can use the following script... modify as necessary (image
names, etc.). Of course, you must make sure the images are
sized right (I'm assuming widths of 640, 800 and 1024, you
may choose to specify your own), and some browsers will
still not display correctly, depending on whether or not the
browser window is maximized, whether taskbars are hidden
or displayed, etc. Also, I haven't fully tested it for version
compatibility.. I know it works with Netscape 4.05, and
that it doesn't work for IE3... If you can live with that, or
you can improve on it, feel free. If I can iron it all out, I'll
try to post the whole thing here as an article.
//put this part in your <HEAD>..</HEAD> block.
var docWidth = screen.width;
function pickBGImage ()
if (docWidth < 800) // if screen is 640x480...
// put this part in the body of your HTML