views:

14

answers:

1

i have function that changes background color of element and src of image. in opera and firefox background changes while image is loading, in ie background changes when image is loaded. so if there any way to change bg in ie before image has not been loaded?

A: 

Try to call both things asynchronously. I.e. first change background color of element then change image source with setTimeout method.

//Change background color
//setTimeout('ChangeSrcImg()',1000);
Chinmayee
thanks, i set up timeout to 1 and now it works as expected
samrockon