How to return to first image in a carousel

Feb 20, 2023

Hi all:

I've got a simple little image carousel interaction here, and I would like to make it so that by clicking the double-arrow button it returns directly back to the first image (i.e., back to the first page of the book).

The images are grouped, and the next and previous buttons are both triggered to move the group on a simple motion path.

It would seem that adding a third motion path would be the way to do it, but I just can't figure out how to set the motion path so that it moves the group back to it's starting place.  Every thing I do seems to bump the group out of alignment.

Thoughts?  Here's the demo so you can see what it's doing now, and I've attached the file if anyone wants to play around.

5 Replies
Walt Hamilton

You may already have these things in the regular project, but just in case, I made a few changes. I subtracted 1 from SitePlanPageCounter when the group moves back. I set the previous buttons to hidden when it gets back to the first page. I set the SitePlanPageCounter variable to start at one when page one is showing. (If you are a computer, or programmer, you may want to change so it is page 0 when page 1 is showing.) I added an invisible shape over the double previous buttons because it was too hard for me to find the exact small magical spot to click when they were a group.

Then I added a layer to jump to Home. (If you are a programmer, it acts like a loop.)

Micah Weedman

Quick follow-up:

I'd like the "loop" or return to happen almost instantly, so I created a third motion path that is identical to the "previous" motion path, except I set the duration to be .1 seconds.  It does that right up until the 2nd image, and then it slows and seems to ease the first image back into place.  That's not horrible, of course, but any thoughts on how to adjust that?

Micah Weedman

Just for anyone following along, Walt's solution worked beautifully and allowed the return to the first image with nice animation.  If you didn't care about the animation, though, my colleague helped me figure out that you could also trigger "back to beginning" button to restart the slide, and then set the slide settings to reset to initial.  You don't have the sliding animation that way, just an instant reset, but it's a nice and simple solution if you didn't care about the animation.