RE: backgrounds again

by "Brian A. Sayrs" <sayrs(at)southwindsolutions.com>

 Date:  Mon, 21 Feb 2000 16:14:53 -0800
 To:  "'William Purnell'" <purnell(at)texas.net>,
"hwg-techniques(at)hwg.org" <hwg-techniques(at)hwg.org>
  todo: View Thread, Original
I don't have time to check this out (sorry...please consider this a =
guess), but I'm pretty certain that NN doesn't define a body object.  =
All of the object properties you'd expect to be part of body are part of =
the document object.  So, while you can do =
document.body.background=3D"/graphics/something.gif" with IE, you =
probably do document.background=3D"/graphics/something.gif" with NN.

In that case, you'd have to check to see if it's IE or NN, then change =
it accordingly.

On the other hand, it also occurs to me that Microsoft knew that NN =
didn't do this correctly, so they also have lots of their body objects =
aliased into their document object, so =
document.background=3D"/graphics/something.gif" might work for both.  I =
know that this works for bgColor, for instance.

Hopefully NN 5 will be DOM compliant, and we will be able to handle =
these problems better in a few years.  :)

Let me know if it works.

Brian A. Sayrs
Owner, Southwind Solutions

-----Original Message-----
From:	William Purnell [SMTP:purnell(at)texas.net]
Sent:	Monday, February 21, 2000 8:23 AM
To:	hwg-techniques(at)hwg.org
Subject:	re: backgrounds again

First let me say thanks for all the invaluable tips I've gotten from
this group.

I have a test on the web that many employees take.  The supporting
application uses a subtle background with no complaints as to the
readability.  The test however, may draw some criticism that it uses a
background.  (hasn't thus far)  Anyway, I wanted to give the user the
ability to choose their own background image/color.  The test is written
out by a cgi script using our company's program libraries.  Those
libraries put a background in the body tag.

How do I use javascript to dynamically change the background/color.  The
following works for IE:
document.body.background=3D"/graphics/something.gif"  but it doesn't =
work
for NN.  I now check the browser and try to use:
document.background.src=3D"/graphics/something.gif"  no use....

If I can't do that, can I use an inline style sheet to override the body
tag?

All this occurs when the onChange event fires from a <Select> tag.

Thanks....

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.