All Projects → ianstormtaylor → create-event

ianstormtaylor / create-event

Licence: other
Create an event object cross browser. Useful for unit testing mostly.

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
Makefile
30231 projects

create-event

Create an event object cross browser. Useful for unit testing mostly.

Installation

$ component install ianstormtaylor/create-event

Example

var create = require('create-event');
var event = create('keydown', {
  ctrl: true,
  key: 'enter'
});

API

createEvent(type, [options])

Types:

'click'
'dblclick'
'keydown'
'keyup'

Default options:

alt        : false,
bubbles    : true,
button     : 0,
cancelable : true,
clientX    : 0,
clientY    : 0,
ctrl       : false,
detail     : 1,
key        : 0, // can be a string like 'enter' for convenience
meta       : false,
screenX    : 0,
screenY    : 0,
shift      : false,
view       : window

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].