events.js 1.6 KB

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