Allow swiping only to the next/previous cell
Touch sliding slides an arbitrary number of cells (i expect to slide only one cell per touch event). Do you know what it is due to? I am thinking of leaving it with freescoll = true, but that is not what i wanted
My configuration is:
var $gallery = $('.carousel-outside').flickity({
prevNextButtons: false,
pageDots: false,
wrapAround: true,
resize: false,
initialIndex: _initialIndex
});
and site is concertsperanadons.cat
I'm having trouble understanding your issue. Can you explain what the expected behavior is, and what the current behavior you are seeing?
It sounds like you only want to slide 1 cell per each swipe. Flickity's behavior allows users to slide past cells, and flick further based on the speed of the flick. Do you want to limit this behavior?
Sorry, I explained myself badly. Yes, exactly, i just want to slide only one cell per swipe.
In desktop mode, by dragging the slider, i achieve OK the behaviour i want. But in touch devices, depending on the flick, a lot of cells pass by and i do not know when it is going to stop.
So, yes, is it possible to limit it to one cell slide, no matter the speed/strength of the flick?
Hello Just as a reminder: Is it possible to have 1 cell slide per each swipe?
Hi, i found the friction param. Now i am sticking with
var _touch = $('html').hasClass('no-touch') ? false :true;
// init Flickity
var $gallery = $('.carousel-outside').flickity({
prevNextButtons: false,
pageDots: false,
wrapAround: true,
resize: true,
initialIndex: _initialIndex,
//freeScroll: _touch,
//draggable: !_touch
friction: _touch ? .6 : .2
});
which is more or less OK if you want lo limit to 1 cell slide per swipe
Yes, adjusting friction is one way to handle it. I'm changing this issue to a feature request.
I feel it's a better user experience to allow users to flick/swipe to further cells. Locking them in to one cell at a time feels limiting.
Add a 👍 reaction to this issue if you would like to see this feature added. Do not add +1 comments — They will be deleted.
+1
Thanks for your support :) !!
+1
+1
+1
I'm confused by the amount of features that are limited based on personal opinion. Shouldn't it be left to the person implementing it to decide what is best for their users?
@drastick My opinion is comprised of multiple factors.
- Does this feature provide considerable value to users? (a little)
- How much demand is there for this feature with developers? (a little)
- How much complexity will adding this feature add to the project? (a good amount)
- Do I like this feature? (not really)
I'm not just considering this one feature, but how it affects the whole project and its end-to-end experience. This project, Flickity, has 20+ open feature requests and it's only been around for a couple months. Being opinionated about which features do and do not get added is good for the health of the project.
If all you do is react to current needs and expressed demands, you will initiate a "customer-driven death spiral." Don't follow the victim.
@desandro I don't disagree that you shouldn't react to everyones whims nor do I believe that all features should be implemented just to say that they are there. I do however feel that core features that other carousels have, and that people are used to, should be strongly considered and voted on to exclude rather than include.
- Does this feature provide considerable value to users? - This is the typical behavior on many mainstream sites that utilize carousels (aol, yahoo). So from a user experience perspective this is what the user will be comfortable with. The flickity implementation goes against the norm. Also based on my testing the friction is pretty finicky on tablet and phone (both iOS) such that it will jump multiple slides in an unpredictable manner. Ex. The same perceived force on one 'flick' will jump 2 slides one time and 4-5 the next.
- How much demand for this feature with developers? - 4 People in a month that care enough to look through issues and +1 a request is a decent number.
- How much complexity will adding this feature add to the project? - Seems like the physics could use some tweaking anyway regardless of if you like this feature. (see my example in question 1)
- Do I like this feature? - shrug
Sorry to drop in, but we are requesting the default behavior of all touch devices when it comes to swiping pictures since ever. You always swipe one at a time. Carousels are quite often used as image galleries, imho
I think a swipe gesture should be the same as an arrow click in a default behavior. After that, you could customize things to do fancier things, don't you think the same?
+1
increasing friction helps reduce flicking through multiple slides, but if you drag the carousel along from one edge of the device to another I'm still able to advance forward more than one slide - would be nice to guarantee that cant happen via an option.
+1
+1 agree completely with drastick. Right now for example I'm trying to use two instances of the plugin on one page that shows a "gallery" of photos. What I have is a large top instance of Flickity that I want to use to show a single image at a time. Below that I want a sliding thumbnail scroll of all the images within the "gallery". Being able to make flickity show just one image at a time would make it so much more flexible.
+1
+1
incase this helps anyone, I set up a swipe limit in the drag code - added a drag width setting
Flickity.defaults = { ..... maxSwipeWidth: 2, // - this controls number of slide widths swipable ..... };
and then in the proto.dragMove = function( I added a limiter...
if( Math.abs(this.dragStartPosition - dragX) > this.size.width * this.options.maxSwipeWidth ){ dragX = this.previousDragX; } this.dragX = dragX;
I have ultimately decided not to add this feature. It was a valid request, but I'm prioritizing other more popular feature requests. Thanks again for submitting this suggestion.