Skip to content
avoidwork edited this page Apr 24, 2012 · 1 revision

mouse

Mouse related methods & properties.

// Logging mouse co-ordinates to the console
$.mouse.enabled = true;
$.mouse.log     = true;

mouse.diff

Property

Mouse co-ordinates offset from last poll

Example

var d = $.mouse.diff,
    x = d.x,
    y = d.y;

mouse.enabled

Property

Boolean indicating whether mouse tracking is enabled

Example

$.mouse.enabled = true;

mouse.log

Property

Boolean indicating whether to try logging co-ordinates to the console

Example

$.mouse.log = true;

mouse.pos

Property

Mouse co-ordinates

Example

var d = $.mouse.pos,
    x = d.x,
    y = d.y;

mouse.prev

Property

Mouse co-ordinates from previous poll

Example

var d = $.mouse.prev,
    x = d.x,
    y = d.y;

mouse.track

Method

Enables or disables mouse co-ordinate tracking

@param  {Mixed} n Boolean to enable/disable tracking, or Mouse Event
@return {Object} abaaso.mouse

Example

$.mouse.track(true);