Skip to content

Added centerSlide option for centering active slide#144

Open
bbeckford wants to merge 2 commits into
sachinchoolur:masterfrom
bbeckford:master
Open

Added centerSlide option for centering active slide#144
bbeckford wants to merge 2 commits into
sachinchoolur:masterfrom
bbeckford:master

Conversation

@bbeckford

Copy link
Copy Markdown

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

Thanks

centerSlide option centers the current slide horizontally.
@ghost

ghost commented Feb 15, 2016

Copy link
Copy Markdown

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

@ghost

ghost commented Feb 15, 2016

Copy link
Copy Markdown

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

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

e-dolan commented Oct 27, 2016

Copy link
Copy Markdown

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

@panique panique left a comment

Copy link
Copy Markdown

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

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

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

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

Can we merge this?

@xenx-efy

Copy link
Copy Markdown

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.