Skip to content
davidaurelio edited this page Sep 14, 2010 · 3 revisions

This is an overview about all global TouchScroll configuration options, including allowed value ranges and recommendations.

  • threshold: Number
    The pixel distance that has to be covered to trigger scrolling. Defaults to 10. 5 is ok on the iPhone, but not for devices with higher pixel density.
  • scrollHandleMinSize: Number
    The minimum size for the scrollbar handles. Defaults to 25. Scrollbars may be taller, depending on the ratio of the sizes of the scroller and its contents.
  • flicking.*
    flicking configuration
    • triggerThreshold: Number
      Longest duration (in milliseconds) between the last touchmove and the touchend event to trigger a flick. Defaults to 150. Lower values might result in not triggering flicks when desired by the user, especially on cheaper touch screens. 100 works good on iPhone etc.
    • friction: Number
      The average friction factor (per millisecond). Used to calculate flick length and duration. Defaults to 0.998. Must be between (not including) 0 and 1. Lower values result in faster deceleration and vice versa. Don’t set lower than 0.95 (very short flick).
    • minSpeed: Number
      The minimum speed (in px/ms) before the flick stops. Used for pre-calculations, not for the actual animations. Defaults to 0.15. Must be positive. Lower values result in longer flicks.
    • timingFunc: Array<Number>
      The control points for the flick animation timing function. Defaults to [0, 0.3, 0.6, 1]. You can use the great graphical tool at netzgesta.de to find values you like.
  • elasticity.*
    bounce configuration
    • factorDrag: Number
      The elasticity factor when dragging. Defaults to 0.5. You really want this to be a number between 0 and 1.
    • factorFlick: Number
      The elasticity factor when flicking. Defaults to 0.2. This should be between 0 and 1, too.
    • max: Number
      Maximum bounce length (in pixels) when flicking. Defaults to 100.
  • snapBack:*
    snap back configuration
    • timingFunc: Array<Number>
      The control points for the snap back timing function. For snap backs following a bounce, the first control point (indexes 0 and 1) is overwritten to achieve a smooth transition. Defaults to [0.4, 0, 1, 1].
    • defaultTime: Number
      The default duration of the snap back in milliseconds. Defaults to 400.
    • alwaysDefaultTime: Boolean
      Whether the snap back effect always uses the default time or uses the bounce out time when following a bounce. Defaults to true.
Clone this wiki locally