-
Notifications
You must be signed in to change notification settings - Fork 241
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
Centre mode #460
Comments
You would probably want to use variable width mode. |
Hmm not sure how that helps? Lory seems to always position the slides to the hard edge (either left or right depending on direction) |
Seems like you realize that this isn't an option currently ;) |
Ha I guess so! So I suppose this is a feature request. What is the effort level required to get this in? |
Any plans for this yet? |
I figured out a way to accomplish this using CSS. Let's say you want 3 slides displayed at a time. Each slide is 200px, and there's a 20px gutter b/w slides. $slideWidth: 200px;
$slideGutter: 20px;
.frame {
width: ($slideWidth * 3) + ($slideGutter * 2);
}
.slide {
transform: translateX($slideWidth + $slideGutter);
width: $slideWidth;
+ .slide {
margin-left: $slideGutter;
}
} lory(slider, { infinite: 3 }); It's not ideal, b/c it doesn't work w/o |
I manage to use some of you css @curtisblackwell but solved it a little different. .slide {
width: 60vw;
transform: translateX(33.333%); // center slide
margin-left:10px;
margin-right:10px;
} |
Any way to center slides if you don't know how much slides you have? |
If you are ok to update lory.js code, I have updated the code to add centerMode functionality. I have added an option for centerMode with
https://github.com/nishantuie/lory/tree/feature/center-mode PR Raised: #763 |
This fix works with all type of slides like variable width and in all breakpoints. Thank You! (y) |
Any update on this? |
@mikailbayram please take a look at PR #763 @Saturate has reviewed and approved PR, he shall merge feature branch to master. Meanwhile, feel free to get code from https://github.com/nishantuie/lory/tree/feature/center-mode Hope this helps. |
@nishantuie thanks for the update! |
👀 |
Hello
How can i configure Lory to centre the slide?
For example, Slick has an option called 'centerMode' which enables me to show one slide only but with mini previews of the previous and next slide.
Thanks
The text was updated successfully, but these errors were encountered: