LeaVerou / inspire.js

Lean, hackable, extensible slide deck framework. Previously known as CSSS.
https://inspirejs.org
MIT License
1.73k stars 254 forks source link

Supporting swipe gestures for smartphones #3

Open LeaVerou opened 13 years ago

LeaVerou commented 13 years ago

One of the biggest issues of CSSS currently is the complete lack of support for mobile devices. I'm not really that experienced with mobile, so I'd welcome a pull request about this. Requirements would be: a) It's small (so no huge libraries please like jQuery touch or whatever) b) It works on at least Safari iPhone and Opera Mobile on touch-enabled devices.

Thanks in advance to anyone that decides to work on this.

humantorch commented 12 years ago

7 months later... how do you envision this behaving? I have a still-a-bit-buggy implementation of left/right swiping firing your .previous() and .next() actions. I was thinking about trying to get up & down swiping to fire .start() and .end(), perhaps.

I also don't have an Opera Mobile device handy, so just testing in iOS for now.

So far, unminified, it's just a shade under 2k with no external dependencies.

LeaVerou commented 12 years ago

I think left/right swiping firing .previous() and .next() is fine, I'd be wary of easily triggering .start() and .end() as they might cause someone to lose where they were in the slideshow (sure, they can press back but still...)

I'd love it if the swipe was real swipe, i.e. you got feedback while dragging by viewing part of the next/previous slide. But I guess that's too hard and would add too much clutter in the codebase :(

2k is fine, as long as it doesn't become 10k after fixing the bugs :)