O'Reilly logo

Ionic Cookbook by Hoc Phan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Detecting drag events with a gesture coordinate

Most mobile UI components leverage dragging to create a better touch-and-feel experience. One common component that you will see everywhere is the scroll list. Another example is the left or right menu. That's why it's important to understand the basic mechanism of a gesture for drag events. It's even possible for you to create custom mobile components using gesture events and pure HTML/CSS/JavaScript.

In this recipe, you will build an app example to understand how to use the data from gesture events. The app will capture drag start, duration, and end events using $ionicGesture to give you granular coordinate data for real-time processing. In terms of the UI, you will create a div box to allow the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required