Fred Janon schreef:
> I am creating dynamically an <img> element in Javascript. I set the
> "src" attribute to a default image file path i.e.
> 'src="images/defaulticon.jpg"' and I would like to be able to override
> that path using CSS.
>
> Basically I would like to see the myicon.jpg and not defaulticon.jpg in
> a configuration like this:
>
>     img {
>     src: url("images/calendar.gif");
>     }
>
> <img style="vertical-align: middle;" src="images/defaulticon.gif"
> id="calendarContainer_Icon">
>   
Fred,

I don't think that's possible. You could, when you create the image 
using javascript, set its "src" to a 100% transparant .GIF or .PNG 
image, and set the defaulticon.gif as background image. Then you could 
change the background image using CSS.

If you'd rather change the source, you'd have to do that using 
javascript as well.

HTH,
Rick.
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to