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

Gallery with 2 images slides images in wrong direction #213

Closed
evvvritt opened this issue Oct 26, 2015 · 10 comments
Closed

Gallery with 2 images slides images in wrong direction #213

evvvritt opened this issue Oct 26, 2015 · 10 comments

Comments

@evvvritt
Copy link

Hi, thanks for developing this plugin.

When I have galleries with just 2 images the sliding animation is using the opposite direction than with 3+. I thought this might be something related to looping the slideshow but it has the same behavior un-looped.

Any advice is appreciated!

$('.lightbox-gallery').lightGallery({
            speed:800,
            loop:true,
            thumbnail:false,
            closable:true,
            hideBarsDelay:2000,
            download:false,
        });
@evvvritt
Copy link
Author

In fact, the demo you provide in the current release (v1.2.6) exhibits the same behavior. However, another site I built using v1.1.5 slides correctly, as does your github.io site though I'm not sure which version it is using...

demo/index.html

@elenista
Copy link

Same problem here (v1.2.15)! And it happens whether the loop is disabled or not. Are you planning to fix the issue?

@mariusschulz
Copy link

@sachinchoolur If I'm not mistaken, the bug lies within these two if statements:

if ((index === 0) && (_prevIndex === _length - 1) && !fromThumb) {
_prev = false;
_next = true;
}
} else if (index > _prevIndex) {
_next = true;
if ((index === _length - 1) && (_prevIndex === 0) && !fromThumb) {
_prev = true;
_next = false;

Would you mind taking a look?

@vercas
Copy link

vercas commented Jul 3, 2016

Still happening on 1.2.21 😦

@artursopelnik
Copy link
Contributor

+1

1 similar comment
@chrisdeeming
Copy link

+1

@srajaee
Copy link

srajaee commented Dec 1, 2016

will pull a fix to this

srajaee added a commit to srajaee/lightGallery that referenced this issue Dec 1, 2016
Fixes these issues
- gallery with 2 items slides items in wrong direction
- gallery with 2 or 3 items doesn't slide properly on drag/swipe to left or right
@whimsicaldreamer
Copy link

Which commit to use?

@carol-braileanu
Copy link

+1, still having this issue

sachinchoolur added a commit that referenced this issue Jan 22, 2017
@sachinchoolur
Copy link
Owner

Hi Guys,
Finally, the issue has been fixed. Please use the latest version of lightGallery

Thank you so much for your patience

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 a pull request may close this issue.

10 participants