TouchScroll icon indicating copy to clipboard operation
TouchScroll copied to clipboard

Flicking to configured 'lock points'

Open ahume opened this issue 14 years ago • 3 comments

A small idea for an enhancement.

Could be implemented by adding a new config parameter which defines in pixels the width or height of repeated 'stopping points' along the width or height of the scrollers content.

This would allow reproducing effects similar to what is seen in the native photo gallery apps in iPhone/iPad, where a flick is used to move the interface to the next or previous picture.

Eg, if I passed in {'stopping-width: 300'} then an initial flick to the right will take me 300px into the content (ie a x offset of -300px), a further flick 600px, etc...

ahume avatar May 03 '10 22:05 ahume

Sounds like a good idea – I might add this at a later time. I would like to get other things straight first.

davidaurelio avatar May 04 '10 06:05 davidaurelio

If you expose a scrollTo method on TouchScroll instances that accepts an x,y screen co-ordinate (inferred from offsets), then users can define their own grid, and snapto at a point they define (normally TouchEnd, so the default 'flick' action would have to be cancelled.

andybeeching avatar May 14 '10 09:05 andybeeching

@jensarps and me hacked preliminary support for this into the stable version with fe9ec73babeb40bcc0e541779686f7d84fa68b5e.

Please try out the feature and report everything that doesn’t work here. Currently it is only possible to flick to a 100% height/width grid. Add {snapToGrid: true} to TouchScroll instantiations.

davidaurelio avatar Aug 06 '10 23:08 davidaurelio