-
Notifications
You must be signed in to change notification settings - Fork 378
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
Adding event fotorama:touchstart, fotorama:touchend #208
Comments
Overkill. I plan to add alternative transition through new |
Indeed, agree with you on that. There appears to be a transition glitch for the keyboard navigation. It tries to complete the transition for each slide, which is correct behavior, but causes repeated keypressed to run the preceding transitions in a queue, instead of one flawless go. It may be fixed by using I've solved the problem in the meantime like this, btw.: $('.fotorama')
.on("touchstart mousedown", ".fotorama__img", function (e) {
var a = $('.fotorama').data('fotorama');
var o = { transition: 'slide', autoplay: false };
a.setOptions(o);
$('.fotorama__caption, .fotorama__caption__wrap')
.stop(true).fadeOut(600);
})
.on("touchend touchcancel mouseup", function (e) {
e.preventDefault();
var a = $('.fotorama').data('fotorama');
var o = { transition: 'crossfade', autoplay: false };
a.setOptions(o);
})
/* The following code isn't necessary, but added for completness */
.on('fotorama:fullscreenenter', function (e, fotorama, extra) {
$(this).removeClass('fotorama-box-shadow');
fotorama.setOptions({
transition: 'crossfade', nav: 'dots'
});
})
.on('fotorama:fullscreenexit', function (e, fotorama, extra) {
$(this).addClass('fotorama-box-shadow');
fotorama.setOptions({
transition: 'crossfade', nav: false, autoplay: '5000'
});
})
.on('fotorama:show', function (e, fotorama, extra) {
$('.fotorama__caption, .fotorama__caption__wrap')
.stop(true).delay(1000).fadeIn(600);
})
.on('mouseenter', function (e, fotorama, extra) {
$('.fotorama__caption, .fotorama__caption__wrap')
.stop(true).delay(400).fadeIn(600);
})
.on('mouseleave', function (e, fotorama, extra) {
$('.fotorama__caption, .fotorama__caption__wrap')
.stop(true).delay(1681).fadeOut(600)
}); |
It would be really useful to have an event called
touchstart
andtouchend
.For example, if you set the the transition to
crossfade/dissolve
and want to allow the more natural transitionslide
only to appear when a slide is dragged/touched.Another use-case is to hide the thumbnails or dots, when you touch the screen.
The text was updated successfully, but these errors were encountered: