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:
<images><image><url>0.jpg</url></image><image><url>1.jpg</url></image></images>
and a snippit of my function that deals with the image src is
for (i=0;i<x.length;i++)
{
txt=txt + "<li>";
xx=x[i].getElementsByTagName("url");
{
try
{txt=txt + "<img class='fade' src='" + xx[0].firstChild.nodeValue + "' />";
}
catch (er)
{txt=txt + "<li class='fade'><img src='images/ajax-loader.gif' /></li>";}
}
txt=txt + "</li>";
}
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