Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to center target slide #227

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dairiki
Copy link

@dairiki dairiki commented Mar 30, 2016

Add boolean option centerSlide. When set, the active slide is centered within the slider, rather than positioned on the left side of the slider.

This is a re-implementation of #144.

@humbertorodrigues
Copy link

Hello!

Any idea how to center even when it's the last/first image?

@haferburg
Copy link

I just tried it out, thank you for the PR. Unfortunately it doesn't work properly. I use {loop: true, autoWidth: true, centerSlide: true}. Which options did you use when you tested?

What does work: On page load, the active slide is centered. The arrow navigation buttons and the dots below do work properly, so that's great.

What doesn't work: When I drag/swipe, it still takes the left-most item and activates it. The active item is then centered, resulting in a big jump, and jerky behavior.

As a side note, I think centerActive would be a better name for this option.

@IlyaBuldakov
Copy link

up

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.

4 participants