Hi there,
You you need to use the gallery’s current index to tell if you reached the end or the start of the gallery.
For example, when attempting to navigate to the next item, check if the current item is the last one, and reset it to the first item, or just move to the next item.
Now use use the event handlers to call the function, and perform the navigation.
const gallery = $w('#gallery');
$w('#next, #prev').onClick(event => {
event.target.id === 'next' ? gallery.next() : gallery.previous()
})
Hope this helps~!
Ahmad