Skip to content

Conversation

@subetha
Copy link

@subetha subetha commented Mar 8, 2015

For more flexibility I added an option to set the number of items moved.
For example you could define the width of the viewport as 4 items wide and move always 4 items at once.
The endless loop will now also work if the number of items in the loop is not multiples of 4. To allow for this the cloning had to be extended to double the number of items.
I have not tested vertical movement and bullets, but it should work as well with the changes.

With this addition the carousel is quite flexible and still very lightweight.

new option: moveNumber, sets the number of slides to be moved with prev/next buttons.
Infinite loops individual combination of viewport size and numer of items moved, eg. total items=7, viewport width=5 * item, move=4
@wieringen
Copy link
Owner

That look really cool!!

Question: I see that there are 2 lines with
$overview.append($slides.slice(0, self.slidesTotal).clone().addClass("mirrored"));
Is that correct?

@subetha
Copy link
Author

subetha commented Mar 9, 2015

Yes. To make the infinite loop work the items have to be mirrored twice. So i just added the cloning another time. I am sure there is a more elegant solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants