bind-event
Bind event handler for all browsers by adding prefix automaticlly.
Install
npm install bind-event --save
Usage
; // bind some event
result
If client's browser support transitionend
event type, it will bind listener function directly to the element. If not, it will automaticlly bind listener function to event type prefix with vendor prefix, such as webkitTransitionend
, mozTransitionend
, etc...
Options
;;
HTMLElement
The Element object you want bind for.
type
, listener
, options
, useCapture
The same as EventTarget.addEventListener()
, read more at MDN.