Tip: Due to lack of browser support, you may want to look at the button property instead. The MouseEvent button property is used to define the left or right click events. The DOM 3 Events Specification defines button identification attributes for mouse events. ; event.relatedTarget – is the element from which the mouse came (relatedTarget → target). 1: It indicates the middle mouse button. Syntax: event.button. Syntax: event.button. The buttons property returns a number that indicates which mouse button or mouse buttons were pressed when a mouse event was triggered. Check out the repository for more tutorials and a handful of … Return Value: This event return an integer value on mouse click events are: The other is event.buttons which is very similar to IE's old handling of event.button, with values 1, 2, 4 adding up if more than one button is held at the same time. The MouseEvent button property is used to define the left or right click events. Topics: MouseEvent, addEventListener, on, click, dblclick, mouseover, mouseout, mousemove, mousedown, enableMouseOver, drag and drop, mouseMoveOutside Target: EaselJS v0.8.2 This tutorial is part of the EaselJS GitHub repository.


Bind an event handler to the “dblclick” JavaScript event, or trigger that event on an element. .hover() Bind one or two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. One is event.button which works the way most browsers now implement it. Note: This property is read-only. These events are special, because they have property relatedTarget.This property complements target.When a mouse leaves one element for another, one of them becomes target, and the other one – relatedTarget.. For mouseover:. After this code executes, clicks on the Trigger button will also append the message: Handler for .mousemove() called at (undefined, undefined) When tracking mouse movement, you usually need to know the actual position of the mouse pointer. This property is mostly used together with the onmousedown event. EaselJS Mouse Interaction. There are in all nine mouse events defined in the DOM Level 3 Events. When mouse button is clicked then it return an integer value which describe the left, right or middle mouse button. When mouse button is clicked then it return an integer value which describe the left, right or middle mouse button. All elements on a webpage support mouse events, and when you cancel the default behaviour of mouse event it affects other events as well, as events are related amongst themselves. The most common group of event used on the Web is the Mouse Events, as a mouse is the most primary navigation device. Synopsis: Learn about mouse events on display objects and the stage. The event object that is passed to the handler contains some information about the mouse coordinates. event.target – is the element where the mouse came over. Return Value: This event return an integer value on mouse click events are: 0: It indicates the left mouse button.