I am loading in an XML document with multiple photos in it, via ajax.
The process my function goes through is this:
Open a UL
Open a LI
Open an img tag
set the src to = the url in the xml document (see below)
close img tag
close LI
open a LI
open an img tag
set the src to = the url in the xml document (see below)
close img tag
close LI
close UL
It creates a new List item and puts the img tag inside for each individual tag in the xml document.
And the xml is this, but with more entries:
0.jpg1.jpg
and a snippit of my function that deals with the image src is
for (i=0;i";
xx=x[i].getElementsByTagName("url");
{
try
{txt=txt + "";
}
catch (er)
{txt=txt + "
";}
}
txt=txt + "";
}
My question is, how do I make these fade in once they have been loaded? and how should i go about adding the loading.gif's behind? I was thinking of a simliar function that writes image tags with loading.gif as the src, then in the function above getting each element by id and changing the src. gonna give this a go, any other soltions welcome. But mainly i need to work out howo to fade this bad boy.
thanks
以上就是Ajax loading images in XML - loading image and fade?的详细内容,更多请关注web前端其它相关文章!