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