Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 50 lines (32 sloc) 1.181 kB
6a533c7 @adamsanderson Initial commit of trigger-event.
adamsanderson authored
1 # trigger-event
2
3 Trigger native DOM events. This is primarily useful for testing, or for
4 triggering common DOM events such as the `change` event for custom components.
5
6 ## Installation
7
8 component install adamsanderson/inline-edit
9
10 See [component](https://github.com/component/component#component) for more information.
11
12 ## API
13
14 ### trigger(el, name, options)
15
16 Triggers the `name` event on `el`. Options may be passed in to customize the event.
17
18 HTMLEvents support the following options:
19
20 bubbles
21 cancelable
22
23 MouseEvents support the following options:
24
25 bubbles
26 cancelable
27 detail (number of clicks)
28 screenX / screenY
29 clientX / clientY
30 ctrlKey
31 altKey
32 shiftKey
33 metaKey
34 button (mouse button)
35
36 See the [W3C Event Spec](http://www.w3.org/TR/DOM-Level-2-Events/events.html) for more details.
37
38 Where sensible, sane defaults will be filled in. See the list of event
39 types for supported events.
40
41 ## Attribution
42
43 This is loosely based on [kangax](https://github.com/kangax)'s [event.simulate.js](https://github.com/kangax/protolicious/blob/master/event.simulate.js).
44
45 ## License
46 MIT
47
48 ---
49
50 Adam Sanderson - http://monkeyandcrow.com
Something went wrong with that request. Please try again.