[thelist] Very basic JavaScript question

Richard Bennett richard.bennett at skynet.be
Thu Sep 30 06:15:54 CDT 2004

On Thursday 30 September 2004 11:52, Shane Miller wrote:
> I don't know JavaScript.  The code pasted below is working well, so that
> users can click a "next" button that calls the next() function and they
> cycle through the images in the array.  What I'd like to do, though, is
> "reset" back to the first picture when I've reached the last image in the
> array.  I would like to hard code that, with an additional if-then
> statement that if the index is four then change the index to zero, but I
> don't know the syntax.

Just change this:

>         if (start > index)
>             start = index;
>         else
>         if (start > index)
>             start = 0;
>         else


More information about the thelist mailing list