9bitStudios/flexisel

Flexisel is infinite in loop

Closed this issue · 5 comments

After attempting to modify the core javascript of flexisel, I can't figure out on disabling the infinite loop of flexisel whenever i click on arrows. I want the flexisel to stop scrolling at the last element of the array.

Example, I have 4 images in an array and i set itemvisible to 3. Because it's more than 3 images, I can scroll by clicking on arrows. However, when it reaches the 4th image, I want it to stop scrolling there. The only way to scroll is to click on the left arrow and scroll back to first element of the array. Even so I also want it to stop scrolling at first element when I click the left arrow.

Anyway for me to resolve this? Thanks.

Does setting the clone: false option accomplish what you are looking to do? If that one is set to false the items do not scroll infinitely.

No it doesn't. Any alternatives?

I suppose I don't understand the behavior you are desiring. I cloned the current repo locally (you can also download a .zip) and I modified the 4th demo (which has 4 images as you've stated you do as well) to the following by adding visibleItems: 3

$("#flexiselDemo4").flexisel({
    visibleItems: 3,
    clone:false
});

and it does stop scrolling on the 4th item. It also stops scrolling when clicking the left arrow all the way left. As I read it, that seems to be the behavior you described when opening the issue. Take a look at that and maybe start there and let me know what additional behavior you want beyond this when the above is implemented.

I retried again. This time it works. The reason it didn't work that day is because I modified the js script before I brought this issue up. Thanks for the solution and sorry about that. Should have reverted back to original for the script before trying.

No worries. Glad that it worked out. I'm going to mark this issue closed for now. Reopen or open a new ticket if further issues arise.