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

autoWidth: true with center: true #420

Open
maxonik opened this issue Jun 4, 2019 · 3 comments
Open

autoWidth: true with center: true #420

maxonik opened this issue Jun 4, 2019 · 3 comments

Comments

@maxonik
Copy link

maxonik commented Jun 4, 2019

Can I use autoWidth: true with center: true ?
Will it work?

@SayChi
Copy link
Contributor

SayChi commented Aug 5, 2019

I was trying this too, it kind of works but when swiping it jumps to the wrong element

@GRA0007
Copy link

GRA0007 commented Oct 10, 2019

Is there any fix planned for this? It would be a very useful addition.

@marcvangend
Copy link

I'm also having trouble combining the autoWidth and center options, but it seems to be an implementation issue rather than a bug in the library. To verify this, I went to the autoWidth-non-loop demo and ran the following commands in the JS console:

// Destroy the current slider instance.
sliders['autoWidth-non-loop'].destroy();
// Initialize an identical slider with the center option added.
sliders['autoWidth-non-loop'] = tns({
  "autoWidth": true,
  "loop": false,
  "mouseDrag": true,
  "container": "#autoWidth-non-loop",
  "swipeAngle": false,
  "speed": 400,
  "center": true
});

This works in the demo page, so I can only conclude that something in my own HTML/CSS code must be breaking it. If I find out what, I'll let you know.

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

No branches or pull requests

4 participants