Thanks, It works great.
On 24 juil, 21:13, Mike Alsup <[EMAIL PROTECTED]> wrote: > On Jul 24, 10:41 am, Anatalsceo <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > I've posted an unresponded post few days ago concerning cycle function > > in jquery. > > > I've change completly the function I was using to be able to get all > > the power of jquery. > > > Here is the function : > > I'm trying to greate a dynamic photo cycle after the info of a XML > > file. > > The xml loads great, but the cycle never runs. > > > any idea ? > > > $(document).ready(function(){ > > > var marque = JSExtraireParamMarque(); > > > // Open the students.xml file > > $.get("xml/listeProduits.xml",{},function(xml){ > > > // Build an HTML string > > myHTMLOutput = ''; > > //myHTMLOutput += '<table width="98%" border="1" > > cellpadding="0" > > cellspacing="0">'; > > //myHTMLOutput += > > '<th>Name</th><th>Age</th><th>Phone</th><th>SSN</ > > th>'; > > > // Run the function for each student tag in the XML file > > > $('marque',xml).each(function(i) { > > > nomMarque = > > $(this).find("nomMarque").text(); > > myRE = new RegExp(nomMarque, "i") > > > if (marque.match(myRE)) { > > > $('produit',xml).each(function(i) { > > nom = > > $(this).find("nom").text(); > > promotion = > > $(this).find("promotion").text(); > > //nomMarque = > > $(this).find("marque").attr("idMarque"); > > > > $('#diaporama').append('<img src="images/'+nom+'.jpg" width="80" > > height="108" />'); > > //buildDiapo (nom); > > }); > > } > > }); > > > //myHTMLOutput += '</table>'; > > > // Update the DIV called Content Area with the HTML string > > }); > > > $('#diaporama').cycle({}); > > > }); > > $.get is asynchronous. So when you call cycle there are no images > appended to #diaporama yet. More the call to cycle up so that it > executes after the $('marque',xml).each... call. If you use Firebug > you should have seen a message from the plugin telling you there were > too few slides. > > Mike