...

View Full Version : document.all[i].style.backgroundImage not reading?



dumdum
04-24-2006, 04:57 PM
:confused: hello

I cant read the backgroundImage property in ie. i am using:

document.all[i].style.backgroundImage

but the property is just showing up blank. I can set it using:

document.all[i].style.backgroundImage= "url(image.jpg)"

i just cant read it?

any ideas?

Kravvitz
04-24-2006, 07:19 PM
Read this: Migrate apps from Internet Explorer to Mozilla - MDC (http://developer.mozilla.org/en/docs/Migrate_apps_from_Internet_Explorer_to_Mozilla)

And this: http://www.quirksmode.org/dom/getstyles.html

Kor
04-25-2006, 10:56 AM
In other words, use id and document.getElementById(id) method instead of document.all[name].

And use currentStyle (for IE) / getComputedStyle (for Moz) to retreive an embeded or external CSS attribute's value (see the Kravitz's links)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum