@pluginjs/events
v0.8.11
Published
A flexible modern events js plugin.
Downloads
258
Readme
Events
events
is a utility JavaScript library for dom event interface.
Introduction
Installation
Yarn
yarn add @pluginjs/events
NPM
npm i @pluginjs/events
Getting Started
CDN:
Development:
<script src="https://unpkg.com/@pluginjs/events/dist/events.js"></script>
Production:
<script src="https://unpkg.com/@pluginjs/events/dist/events.min.js"></script>
API
trigger
Parameters
| Name | Type | Description |
|||-|
| event | String or CustomEvent
| evnetName or customEvent |
| [ extraParams ] | String or PlainObject
| one or more or null |
| element | HTMLElement
| |
bindEvent
Parameters
| Name | Type | Description |
|||-|
| events | String
| One or more space-separated event types and optional namespaces |
| [ selector ] | String
| |
| callback | Function
| |
| element | HTMLElement
| |
Returns
| Name | Type | Description |
|||-|
| element | HTMLElement
| |
removeEvent
Parameters
| Name | Type | Description |
|||-|
| events | String
| One or more space-separated event types and optional namespaces |
| [ selector ] | String
| |
| callback | Function
| |
| element | HTMLElement
| |
Returns
| Name | Type | Description |
|||-|
| element | HTMLElement
| |
bindEventOnce
Parameters
| Name | Type | Description |
|||-|
| events | String
| One or more space-separated event types and optional namespaces |
| [ selector ] | String
| |
| callback | Function
| |
| element | HTMLElement
| |
Returns
| Name | Type | Description |
|||-|
| element | HTMLElement
| |
getEventEmitter
Parameters
| Name | Type | Description |
|||-|
| element | HTMLElement
| |
Returns
| Name | Type | Description |
|||-|
| eventEmitter | EventEmitter
| |
Browser support
Tested on all major browsers.
| IE / Edge | Firefox | Chrome | Safari | Opera | | --------- | --------- | --------- | --------- | --------- | | IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions|
License
@pluginjs/events is Licensed under the GPL-v3 license.
If you want to use @pluginjs/events project to develop commercial sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary.
For purchase an Commercial License, contact us [email protected].
Copyright
Copyright (C) 2022 Creation Studio Limited.