Skip to main content

ScrollTrigger.isTouch

ScrollTrigger.isTouch : Number

A way to discern the touch capabilities of the current device - 0 is mouse/pointer only (no touch), 1 is touch-only, 2 accommodates both.

Details

A way to discern the touch capabilities of the device:

  • 0 - no touch (pointer/mouse only)
  • 1 - touch-only device (like a phone)
  • 2 - device can accept touch input andmouse/pointer (like Windows tablets)
if (ScrollTrigger.isTouch) {
// any touch-capable device...
}

// or get more specific:
if (ScrollTrigger.isTouch === 1) {
// touch-only device
}

Contents