Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var touchEvent = function (_event) {
- if (cancelSwipe) return;
- if (xStart > _event.x && (xStart - _event.x > swipeValue) && itemId != fullLength-1) {
- cancelSwipe = true;
- xStart = _event.x;
- itemId++;
- $.createRecipeListItem(recipesList[itemId], itemId);
- $.navigateInfo.text = (itemId + 1) + ' / ' + fullLength;
- } else if (xStart < _event.x && (_event.x - xStart > swipeValue) && itemId != 0) {
- cancelSwipe = true;
- xStart = _event.x;
- itemId--;
- $.createRecipeListItem(recipesList[itemId], itemId);
- $.navigateInfo.text = (itemId + 1) + ' / ' + fullLength;
- }
- };
- nextItem.removeEventListener('touchmove', touchEvent);
- nextItem.addEventListener('touchmove', touchEvent);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement