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

Added centerSlide option for centering active slide #144

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bbeckford
Copy link

This is my first git pull request, new to this!

Thanks

centerSlide option centers the current slide horizontally.
@ghost
Copy link

ghost commented Feb 15, 2016

why has this not been merged yet? Is this project abandoned?

@ghost
Copy link

ghost commented Feb 15, 2016

Found that the above is not working properly, this is a little better; (in same position of code). Can probably be optimized tho..

              if ($(ob).hasClass("lightSlider")) {
                var imgWidth = $children.eq(scene).find("img").width();
                if (imgWidth < slideWidth) {
                  v -= (slideWidth - imgWidth) / 2;
                }
              }

dairiki added a commit to dairiki/lightslider that referenced this pull request Mar 30, 2016
@Davion1089
Copy link

I found that this shifts the pager to the right, not sure why, but it certainly seems that it's pushing it to the right a 'half' space.

Probably part of the changes to modify the width, it's effecting the positioning of the pager.

@e-dolan
Copy link

e-dolan commented Oct 27, 2016

Has this been implemented fully yet? I've added the lightslider.js file but breaks the layout and shifts to the right?

Copy link

@panique panique left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really good, but only works when images have the exact same width (at least that's how it was in my tests)

@User0816
Copy link

I don't see any css rule lScenterSlide which should fix this issue. I still don't know how to center the picture and thumbnails if the picutre is smaller than the container

@hehuiiuheh
Copy link

This css code can center the thumbnail relative to the picture, when the number of thumbnail is not much:
.lSSlideOuter .lSPager.lSGallery {margin:0 auto;}

@ronaldaug
Copy link

Oh,this pull request is seen 2015.
lightslider should implement this option..
Currently, I get the center slide with CSS selector like this.

ul#light-slider  li.active + li{
            border:2px solid red;
}

@OliverP-1qbit
Copy link

Can we merge this?

@xenx-efy
Copy link

It doesn't work, check that pr #227, works for me.

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.