|
|
 |
Re: FN-FORUM: Problem with getElementById and Mac IE
date posted 11th May 2006 13:12
> Hi, can someone with some Javascript / DOMscripting knowledge please
> help:
>=20
> I'm trying to update the background image of a div =
(id=3D"bannerRight")
> using some scripting. The stylesheet sets one image as the div
> background and when the page loads I want to load a different one in
> (this'll be from a random selection, but I've left that code out as =
it's
> not the problem.) What I've done works OK in Firefox, Safari and IE6,
> but I can't get it working in Mac IE, where instead of loading another
> image it just removes the original image and doesn't load a new one.
>=20
> The problem seems to be with this bit of code, which I presume I've =
got
> wrong somehow:
>=20
> document.getElementById('bannerRight').style.backgroundImage =3D
> "url('images/2.jpg')";
>=20
> All the page source is below if that helps. I'd like to either get it
> working in Mac IE, or just get that browser to ignore what I'm trying =
to
> do and to leave the original image in place.
>=20
> Any help gratefully received!
>=20
> Cheers
>=20
> Paul
>=20
I remember vaguely a similar problem and suspect it is a bug on =
single/double/no quotes
re mac ie. If you can detect Mac IE then use different delimiters for =
mac ie to single quotes for others. e.g. try 'url("images/2.jpg")'
John
|
 |
|