<HTML><BODY STYLE="font:10pt verdana; border:none;"><DIV>You will not need a real loop here.</DIV> <DIV> </DIV> <DIV>It can be done with simple count, and if this will get called by some event like click for instance,</DIV> <DIV>and afterwards; -if you like, after the fifth show, the return to the 1st, this one will do very good, </DIV> <DIV>but if you, for some unkwnown reason,would like to cycle through 1,2,3,4,5, with only two images, -that I can't understand, </DIV> <DIV>without stopping, use the timer and adjust it to you're need's, just enable it by deleting the comment glyphs '//' infront of the timer <STRONG>x</STRONG></DIV> <DIV> </DIV> <DIV>So,</DIV> <DIV>Count the clicks than...</DIV> <DIV> </DIV> <DIV> </DIV> <DIV> <DIV><EM><STRONG> var j=0;</STRONG></EM></DIV> <DIV><STRONG><EM></EM></STRONG> </DIV></DIV> <DIV><STRONG>function countTo5(){</STRONG></DIV> <DIV><EM><STRONG></STRONG></EM> </DIV> <DIV><EM><STRONG>var intrv =1000; </STRONG>// equals 1sec interval</EM></DIV> <DIV><STRONG></STRONG> </DIV> <DIV><STRONG> if(j<1){j++;</STRONG></DIV> <DIV><EM><STRONG> </STRONG>//point here to image one</EM></DIV> <DIV><STRONG> }</STRONG></DIV> <DIV><STRONG>else if(j<5){j++;</STRONG></DIV> <DIV><STRONG> </STRONG><EM>//point to image two</EM></DIV> <DIV><STRONG> }</STRONG></DIV> <DIV><STRONG> else{j=1</STRONG></DIV> <DIV> <DIV><EM><STRONG> </STRONG>//point here to image one</EM></DIV></DIV> <DIV><STRONG> }</STRONG></DIV> <DIV><STRONG>//x=window.setTimeout('countTo5()', intrv)</STRONG></DIV> <DIV><STRONG>}</STRONG></DIV> <DIV> </DIV> <DIV>Regards.<BR></DIV> <BLOCKQUOTE style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> <DIV style="FONT: 10pt Arial">----- Original Message -----</DIV> <DIV style="BACKGROUND: #e4e4e4; FONT: 10pt Arial; FONT-COLOR: black"><B>From:</B> Christopher J. Baldoza</DIV> <DIV style="FONT: 10pt Arial"><B>Sent:</B> Monday, May 21, 2001 6:07 AM</DIV> <DIV style="FONT: 10pt Arial"><B>To:</B> 'javascript@LaTech.edu'</DIV> <DIV style="FONT: 10pt Arial"><B>Subject:</B> [Javascript] Looping</DIV> <DIV><BR></DIV>Hi,<BR> I'm beginner with Javascript. Can anyone give me an example of simple<BR>Loop script. I want to look the script like this. I have 2 images and I want to<BR>show the first images dependent to the given number and the max is 5 if the<BR>given number for example is '1' then it will show the 1st image once and the<BR>2nd image will be four times.<BR> Thanks in advance. :)<BR><BR>Thope<BR><BR>_______________________________________________<BR>Javascript mailing list<BR>Javascript@LaTech.edu<BR>http://www.LaTech.edu/mailman/listinfo/javascript<BR> <DIV></DIV></BLOCKQUOTE></BODY></HTML><DIV><BR><br clear=all><hr>Get Your Private, Free E-mail from MSN Hotmail at <a href="http://www.hotmail.com">http://www.hotmail.com</a>.<br></p></DIV>