Hi, Im new here and really need some help on a javascript functions, as Im not too experienced with javascript code yet, and not quite sure how to approach this. I have a function to play a photo slide show with fade transitions. What can I use in place of Math.random so that the photos display in sequential order and not random order? Here is my existing code: function doOn(_i,_n) { eval("fade(document[\""+_i+"\"],_"+_n+".src)"); /* var next = ((_n+1)%11); if(next==0) next=1; */ var next = _n; while(next == _n) { next = Math.round(1 * Math.random())+1; } if(timerv!=null) clearTimeout(timerv); timerv=setTimeout("doOn('"+_i+"',"+next+")",6000); //alert("document[\""+_i+"\"].src="+_n+".src"); } Code (markup): Thanks for any help you can give me. NJ
Hi jwlnewsome, Thanks for the quick reply and the link. However, the link you gave me had to do mostly with transition and fade effects, which is cool, thanks, but I am mostly concerned with a javascript function to show sequential photos rather than random photos. I know it has something to do with this line, but just not sure exactly what. next = Math.round(1 * Math.random())+1; Code (markup): Thanks though.
Is there a replacement for Math.random that would give me sequential display of my photos rather than random display? I've researched on javascript websites and can't find anything. Any help on this would be greatly appreciated. Thanks!
Anyone else have an idea about this? Again, Im trying to have pics in this javascript slideshow display sequentially, not randomly. Thank you very much for taking the time to help if you can! NJ