Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var touchEvent = function (_event) {
  2.         if (cancelSwipe) return;
  3.         if (xStart > _event.x && (xStart - _event.x > swipeValue) && itemId != fullLength-1) {
  4.             cancelSwipe = true;
  5.             xStart = _event.x;
  6.             itemId++;
  7.             $.createRecipeListItem(recipesList[itemId], itemId);    
  8.             $.navigateInfo.text = (itemId + 1) + ' / ' + fullLength;                    
  9.         } else if (xStart < _event.x && (_event.x - xStart > swipeValue) && itemId != 0) {
  10.             cancelSwipe = true;
  11.             xStart = _event.x;
  12.             itemId--;
  13.             $.createRecipeListItem(recipesList[itemId], itemId);
  14.             $.navigateInfo.text = (itemId + 1) + ' / ' + fullLength;        
  15.         }
  16.     };
  17.  
  18. nextItem.removeEventListener('touchmove', touchEvent);
  19. nextItem.addEventListener('touchmove', touchEvent);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement