# What is the "logical" way to create a next image function?

**URL:** <https://forum.kirupa.com/t/what-is-the-logical-way-to-create-a-next-image-function/222317>\
**Category:** Uncategorized\
**Created:** [April 12, 2007, 2:49pm UTC](https://forum.kirupa.com/t/what-is-the-logical-way-to-create-a-next-image-function/222317 "2007-04-12T14:49:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rosanna](https://avatars.discourse-cdn.com/v4/letter/r/e0b2c6/32.png) [@rosanna](https://forum.kirupa.com/u/rosanna)\
**Post date:** [April 12, 2007, 2:49pm UTC](https://forum.kirupa.com/t/what-is-the-logical-way-to-create-a-next-image-function/222317/1 "2007-04-12T14:49:47Z")

</div>

strange question…I explain myself.  
There are of course 10000 tutos with xml gallery featuring a \< previous and a \> next image button.  
I succedeed to create a quite nice photo gallery with thumbs by myself with tuts here and there, but I can not figure out the real logic( not a math minded ;-() to create the functions of the buttons that allows to go to the previous and next photo.  
Could somebody explain me this logic ?  
It must be something with a if condition, no ?  
Thank you for your tips.
