Tutorial: Handlers and events

Handlers and events

touchSwipe Fork me on GitHub

events: *

See the docs for more on each event

You can assign event handlers in two ways; as callback handlers in the options object, or as event listeners using the jQuery $.on/$.off event registration.

Both methods are exactly the same, and can be removed / added again with $.on/$.off

The example below logs both approaches whilst you swipe.

  • The box is initialised with options callback handlers.
  • Press `Remove Options handlers` to remove them.
  • Press `Attach Event listeners` to add listeners after initialization.
Event listeners attached with $.on/$.off are logged in bold.


			

			
I have all the options handlers enabled
Swipe me first!