Darn, it crashes Safari on my iPad. Ironic given that the iDevices are the ones providing onus to developers to use HTML5 in the first place. /-:
var addTouchListeners = function() {
document.addEventListener('touchstart', function(e) {
touchStartX = e.touches[0].pageX;
}, false);
document.addEventListener('touchend', function(e) {
var pixelsMoved = touchStartX - e.changedTouches[0].pageX;
var SWIPE_SIZE = 150;
if (pixelsMoved > SWIPE_SIZE) {
nextSlide();
}
else if (pixelsMoved < -SWIPE_SIZE) {
prevSlide();
}
}, false);
};Hopefully some geeks at Apple have seen this and are already fixing bugs that it uncovers.