events.js 1.2 KB

123456789101112131415161718192021222324252627
  1. App.Events = (function(lng, app, undefined) {
  2. lng.dom('#event_touchstart').touch(function(event) { alert("touchstart!"); });
  3. //OR
  4. //lng.dom('#event_touchstart').on('touchstart', function(event) { alert("TOUCH_START!"); });
  5. lng.dom('#event_touchend').on('touchend', function(event) { alert("touchend!"); });
  6. lng.dom('#event_touchmove').on('touchmove' , function(event) { alert("touchmove!"); });
  7. //Tap Methods
  8. lng.dom('#event_tap').tap(function(event) { alert("tap!"); });
  9. //OR
  10. //lng.dom('#event_tap').on('tap', function(event) { alert("TAP!"); });
  11. lng.dom('#event_doubletap').doubleTap(function(event) { alert("doubleTap!"); });
  12. lng.dom('#event_longtap').longTap(function(event) { alert("longTap!"); });
  13. //Swipe Methods
  14. lng.dom('#swipe').swipe(function(event) { alert("swipe!"); });
  15. lng.dom('#swipe_left').swipeLeft(function(event) { alert("swipeLeft!"); });
  16. lng.dom('#swipe_right').swipeRight(function(event) { alert("swipeRight!"); });
  17. lng.dom('#swipe_up').swipeUp(function(event) { alert("swipeUp!"); });
  18. lng.dom('#swipe_down').swipeDown(function(event) { alert("swipeDown!"); });
  19. lng.dom('a[href="#scrolls"]').on('tap', function(event) {
  20. App.View.mockScrolls();
  21. });
  22. })(LUNGO, App);