events.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. App.Events = (function(lng, undefined) {
  2. /*
  3. lng.dom(document).ready(function() {
  4. });
  5. */
  6. lng.dom('#event_touchstart').touch(function(event) { alert("touchstart!"); });
  7. //OR
  8. //lng.dom('#event_touchstart').on('touchstart', function(event) { alert("TOUCH_START!"); });
  9. lng.dom('#event_touchend').on('touchend', function(event) { alert("touchend!"); });
  10. lng.dom('#event_touchmove').on('touchmove' , function(event) { alert("touchmove!"); });
  11. //Tap Methods
  12. lng.dom('#event_tap').tap(function(event) { alert("tap!"); });
  13. //OR
  14. //lng.dom('#event_tap').on('tap', function(event) { alert("TAP!"); });
  15. lng.dom('#event_doubletap').doubleTap(function(event) { alert("doubleTap!"); });
  16. lng.dom('#event_longtap').longTap(function(event) { alert("longTap!"); });
  17. //Swipe Methods
  18. lng.dom('#swipe').swipe(function(event) { alert("swipe!"); });
  19. lng.dom('#swipe_left').swipeLeft(function(event) { alert("swipeLeft!"); });
  20. lng.dom('#swipe_right').swipeRight(function(event) { alert("swipeRight!"); });
  21. lng.dom('#swipe_up').swipeUp(function(event) { alert("swipeUp!"); });
  22. lng.dom('#swipe_down').swipeDown(function(event) { alert("swipeDown!"); });
  23. lng.dom('a[href="#scrolls"]').on('tap', function(event) {
  24. App.View.mockScrolls();
  25. });
  26. //SPECIAL
  27. $$('section#navigation').on('load', function(event) {
  28. console.error('Load #navigation', event);
  29. });
  30. $$('section#navigation').on('unload', function(event) {
  31. console.error('Unload', event);
  32. });
  33. $$('article#authors').on('load', function(event) {
  34. console.error('loaded article');
  35. });
  36. })(LUNGO);