mladenilic/threesixty.js

stop looping on first frame rather than last

zanona opened this issue · 2 comments

zanona commented

Whenever using play(false, 1) it spins once, but then it stops on the last frame of the cycle rather than the first one.
For product previews, this might not be ideal since the first frame is facing the camera and the last would be a bit off angle.
Is there a way to make it stop on the first frame instead?
Thanks

zanona commented

Perhaps line 139 could be replaced by the below instead of using stop?

this.goto(-1);

_loop(reversed) {
reversed ? this.prev() : this.next();
if(this.#index === 0) {
this.nloops += 1;
if (this.#maxloops && this.nloops >= this.#maxloops) {
this.stop();
return;
}
}

zanona commented

Never mind, I spotted it was an issue on the way I was passing the array of images reversed. closing