bradbirdsall/Swipe — pull request #329 by dpolivy (2013-07-24 17:07:32+00:00)
Title: Add Mouse and IE10/Win8/WinPhone8 (MSPointer) support

I found the existing MSPointer solutions to be a bit heavyweight, so here is my contribution to the project. A more streamlined approach to adding support for both mouse and MSPointer events.

The priority order for listening to events is (based on feature detection in the browser):
1) touch[start|move|end]
2) MSPointer[Down|Move|Up]
3) mouse[down|move|up]

The addition of -ms-touch-action is necessary in CSS to prevent the default scrolling behaviors; setting the value to 'pan-y' allows for you to still vertically scroll the page by tapping on the swipe element, while horizontal swiping will navigate through the slides as expected. If your carousel is arranged vertically, instead, you can adjust this value as appropriate for the desired behavior.

Furthermore, I suppress 'click' events on the swipe element (for mouse/MSPointer events). When swiping, I found the click event was firing, and propagating up the page causing undesired side effects (mostly with jQuery Mobile and a fixed header).

Hopefully you'll find this useful to merge. I also appreciate any feedback on how to improve upon these changes.