Module: zrender/mixin/Eventful

zrender/mixin/Eventful

new require("zrender/mixin/Eventful")()

mixin/Eventful.js, line 14

事件分发器

事件扩展

Author:
  • Kener (@Kener-林峰, kener.linfeng@gmail.com) pissang (https://www.github.com/pissang)

Methods

bind(event, handler, context)

mixin/Eventful.js, line 50

绑定事件

Name Type Description
event string

事件名

handler function

事件处理函数

context Object optional

dispatch(type)

mixin/Eventful.js, line 110

事件分发

Name Type Description
type string

事件类型

dispatchWithContext(type)

mixin/Eventful.js, line 156

带有context的事件分发, 最后一个参数是事件回调的context

Name Type Description
type string

事件类型

one(event, handler, context)

mixin/Eventful.js, line 24

单次触发绑定,dispatch后销毁

Name Type Description
event string

事件名

handler function

响应函数

context Object

unbind(event, handler)

mixin/Eventful.js, line 75

解绑事件

Name Type Description
event string

事件名

handler function optional

事件处理函数

Events

onclick

mixin/Eventful.js, line 200
Type:
  • function
Default Value:
  • null

ondragend

mixin/Eventful.js, line 240
Type:
  • function
Default Value:
  • null

ondragenter

mixin/Eventful.js, line 245
Type:
  • function
Default Value:
  • null

ondragleave

mixin/Eventful.js, line 250
Type:
  • function
Default Value:
  • null

ondragover

mixin/Eventful.js, line 255
Type:
  • function
Default Value:
  • null

ondragstart

mixin/Eventful.js, line 235
Type:
  • function
Default Value:
  • null

ondrop

mixin/Eventful.js, line 260
Type:
  • function
Default Value:
  • null

onmousedown

mixin/Eventful.js, line 225
Type:
  • function
Default Value:
  • null

onmousemove

mixin/Eventful.js, line 215
Type:
  • function
Default Value:
  • null

onmouseout

mixin/Eventful.js, line 210
Type:
  • function
Default Value:
  • null

onmouseover

mixin/Eventful.js, line 205
Type:
  • function
Default Value:
  • null

onmouseup

mixin/Eventful.js, line 230
Type:
  • function
Default Value:
  • null

onmousewheel

mixin/Eventful.js, line 220
Type:
  • function
Default Value:
  • null