MooTools Event

Call class function from event handler

var NaMooEvent = new Class({initialize: function(){$(link).addEvent(click,this.on.bind(this.event)); /*this.event*/},on: function(event){console.log(event);}});

Properties:

  • page.x - (number) The x position of the mouse, relative to the full window.
  • page.y - (number) The y position of the mouse, relative to the full window.
  • client.x - (number) The x position of the mouse, relative to the viewport.
  • client.y - (number) The y position of the mouse, relative to the viewport.
  • rightClick - (boolean) True if the user clicked the right mousebutton
  • wheel - (number) The amount of third button scrolling.
  • relatedTarget - (element) The event related target.
  • target - (element) The event target.
  • code - (number) The keycode of the key pressed.
  • key - (string) The key pressed as a lowercase string. key can be enter, up, down, left, right, space, backspace, delete, and esc.
  • shift - (boolean) True if the user pressed the shift key.
  • control - (boolean) True if the user pressed the control key.
  • alt - (boolean) True if the user pressed the alt key.
  • meta - (boolean) True if the user pressed the meta key.

http://mootools.net/docs/core/Types/DOMEvent


Element.NativeEvents = {click: 2, dblclick: 2, mouseup: 2, mousedown: 2, contextmenu: 2, //mouse buttonsmousewheel: 2, DOMMouseScroll: 2, //mouse wheelmouseover: 2, mouseout: 2, mousemove: 2, selectstart: 2, selectend: 2, //mouse movementkeydown: 2, keypress: 2, keyup: 2, //keyboardorientationchange: 2, // mobiletouchstart: 2, touchmove: 2, touchend: 2, touchcancel: 2, // touchgesturestart: 2, gesturechange: 2, gestureend: 2, // gesturefocus: 2, blur: 2, change: 2, reset: 2, select: 2, submit: 2, //form elementsload: 2, unload: 1, beforeunload: 2, resize: 1, move: 1, DOMContentLoaded: 1, readystatechange: 1, //windowerror: 1, abort: 1, scroll: 1 //misc};