flickity icon indicating copy to clipboard operation
flickity copied to clipboard

Allow swiping only to the next/previous cell

Open permanyer opened this issue 11 years ago • 19 comments

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

permanyer avatar Mar 20 '15 13:03 permanyer

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?

desandro avatar Mar 20 '15 15:03 desandro

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?

permanyer avatar Mar 20 '15 16:03 permanyer

Hello Just as a reminder: Is it possible to have 1 cell slide per each swipe?

permanyer avatar Mar 23 '15 11:03 permanyer

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

permanyer avatar Mar 24 '15 17:03 permanyer

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.

desandro avatar Mar 24 '15 19:03 desandro

+1

Thanks for your support :) !!

permanyer avatar Mar 25 '15 08:03 permanyer

+1

pesla avatar Apr 10 '15 11:04 pesla

+1

saunders1989 avatar Apr 23 '15 15:04 saunders1989

+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 avatar May 04 '15 14:05 drastick

@drastick My opinion is comprised of multiple factors.

  1. Does this feature provide considerable value to users? (a little)
  2. How much demand is there for this feature with developers? (a little)
  3. How much complexity will adding this feature add to the project? (a good amount)
  4. 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.

— Alan Cooper

desandro avatar May 04 '15 15:05 desandro

@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.

  1. 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.
  2. 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.
  3. 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)
  4. Do I like this feature? - shrug

drastick avatar May 04 '15 15:05 drastick

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?

permanyer avatar May 04 '15 15:05 permanyer

+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.

timkirtley avatar Jul 07 '15 16:07 timkirtley

+1

jgerigmeyer avatar Oct 19 '15 17:10 jgerigmeyer

+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.

adam-jones-net avatar May 09 '16 13:05 adam-jones-net

+1

LBKinson avatar Jun 01 '16 18:06 LBKinson

+1

kaiserkiwi avatar Jun 07 '17 08:06 kaiserkiwi

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;

harrisdavid avatar Aug 07 '17 11:08 harrisdavid

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.

desandro avatar Jun 29 '19 11:06 desandro