Entry
ow do I dynamically change a style attribute in a CASCADED style element? (eg: elementRef.style.backgroundImage)
Aug 11th, 2000 09:50
Rey Nuņez, Pat Friedl,
IE4+ and NN6 allow dynamically changing style attributes using the
basic DOM notation:
elementRef.style.propertyName
For example, to change a background image's source in response to mouse
events:
onmouseover="this.style.backgroundImage = 'url(filepath/imagefile.jpg)'"
NN4 does not support the DOM style object, but allows changing the
background image of content bound by its proprietory LAYER element.
document['layerRef'].background= 'imagefile.jpg'
For information on changing the background image of the BODY, plese see:
http://www.faqts.com/knowledge-base/view.phtml/aid/993/fid/126