-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
How to change the slide transition time? #2077
Comments
If you want to adjust the speed of the animation from PhotoSwipe/src/js/main-scroll.js Line 140 in 2d23b36
The transition between slides is a common request, hopefully, in the future versions, it'll be implemented. End users often dislike if intrusive transition is added to this type of gallery, so it must be very light. |
Thanks @dimsemenov for the information. |
I'm not sure what you're trying to modify the source for, but if you want to override the |
Sorry @dimsemenov I am not an expert Javascript programmer, so I have no idea how I can do what your proposes. |
Here is a basic example, but I don't recommend doing such modifications if you're not a programmer. class CoolerPhotoSwipe extends PhotoSwipe {
goTo(index) {
// your goTo logic
// or call the parent method
// super.goTo(index);
}
}
const lightbox = new PhotoSwipeLightbox({
gallery: '#gallery',
children: 'a',
pswpModule: CoolerPhotoSwipe
});
lightbox.init(); https://photoswipe.com/getting-started#without-dynamic-import |
Thanks again @dimsemenov , I will do some tests, but I still see in your example no reference to the velocityX parameter. Edit: |
@acwolff It would be so easy with Fancybox, but I understand you chose this because of the licensing. |
I use transitions if you go to a next image in the light-box as you see in this test album. I use the method described in issue #1765
However the used transition time is rather fast, I like to give the viewer the possibility to select another transition time.
The duration of the transition is determined by parameter naturalFrequency in this code in module photoswipe.esm.js:
My question is:
How can I change / overrule the naturalFrequency without changing the source code of module photoswipe.esm.js, so by an option or with CSS code.
@dimsemenov In case that is not yet possible, could you please please offer such a feature in the next version?
The text was updated successfully, but these errors were encountered: