Skip to content

Add option to center target slide#227

Open
dairiki wants to merge 1 commit into
sachinchoolur:masterfrom
dairiki:feature.center-slide
Open

Add option to center target slide#227
dairiki wants to merge 1 commit into
sachinchoolur:masterfrom
dairiki:feature.center-slide

Conversation

@dairiki

@dairiki dairiki commented Mar 30, 2016

Copy link
Copy Markdown

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
Copy Markdown

Hello!

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

@haferburg

Copy link
Copy Markdown

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
Copy Markdown

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