Open SukhKalsi opened 7 years ago
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 infinite
(can't focus on last two), but it'll do for now on this project.
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: https://github.com/loryjs/lory/pull/763
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
- the first slide center align
- the first slide left align
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?
Any update on this?
@mikailbayram please take a look at PR https://github.com/loryjs/lory/pull/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!
:eyes:
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