<HTML><BODY STYLE="font:10pt verdana; border:none;"><DIV>You will not need a real loop here.</DIV> <DIV>&nbsp;</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,&nbsp;the return to the 1st, this one will do very good, </DIV> <DIV>but if you, for some unkwnown reason,would like&nbsp;to cycle through 1,2,3,4,5, with only two images, -that I can't understand, </DIV> <DIV>without stopping,&nbsp;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>&nbsp;</DIV> <DIV>So,</DIV> <DIV>Count the clicks than...</DIV> <DIV>&nbsp;</DIV> <DIV>&nbsp;</DIV> <DIV> <DIV><EM><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var j=0;</STRONG></EM></DIV> <DIV><STRONG><EM></EM></STRONG>&nbsp;</DIV></DIV> <DIV><STRONG>function countTo5(){</STRONG></DIV> <DIV><EM><STRONG></STRONG></EM>&nbsp;</DIV> <DIV><EM><STRONG>var intrv =1000;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </STRONG>// equals 1sec interval</EM></DIV> <DIV><STRONG></STRONG>&nbsp;</DIV> <DIV><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(j&lt;1){j++;</STRONG></DIV> <DIV><EM><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</STRONG>//point here to image one</EM></DIV> <DIV><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</STRONG></DIV> <DIV><STRONG>else if(j&lt;5){j++;</STRONG></DIV> <DIV><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </STRONG><EM>//point&nbsp;to image two</EM></DIV> <DIV><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</STRONG></DIV> <DIV><STRONG>&nbsp;&nbsp;else{j=1</STRONG></DIV> <DIV> <DIV><EM><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</STRONG>//point here to image one</EM></DIV></DIV> <DIV><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</STRONG></DIV> <DIV><STRONG>//x=window.setTimeout('countTo5()', intrv)</STRONG></DIV> <DIV><STRONG>}</STRONG></DIV> <DIV>&nbsp;</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>&nbsp;Christopher J. Baldoza</DIV> <DIV style="FONT: 10pt Arial"><B>Sent:</B>&nbsp;Monday, May 21, 2001 6:07 AM</DIV> <DIV style="FONT: 10pt Arial"><B>To:</B>&nbsp;'javascript@LaTech.edu'</DIV> <DIV style="FONT: 10pt Arial"><B>Subject:</B>&nbsp;[Javascript] Looping</DIV> <DIV><BR></DIV>Hi,<BR>&nbsp;&nbsp;&nbsp;&nbsp; I'm beginner with Javascript. Can anyone give me an example of&nbsp; 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>&nbsp;&nbsp;&nbsp;&nbsp; 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>