Module: zrender/Handler

zrender/Handler

new require("zrender/Handler")(root, storage, painter)

Handler.js, line 416
Name Type Description
root HTMLElement

绘图区域

storage module:zrender/Storage

Storage实例

painter module:zrender/Painter

Painter实例

Handler控制模块

Author:
  • Kener (@Kener-林峰, kener.linfeng@gmail.com) errorrik (errorrik@gmail.com)

Methods

dispose()

Handler.js, line 524

释放,解绑所有事件

on(eventName, handler, context)

Handler.js, line 486

自定义事件绑定

Name Type Description
eventName string

事件名称,resize,hover,drag,etc~

handler function

响应函数

context Object optional

响应函数

trigger(eventName, eventArgs)

Handler.js, line 506

事件触发

Name Type Description
eventName string

事件名称,resize,hover,drag,etc~

eventArgs event optional

event dom事件对象

un(eventName, handler)

Handler.js, line 496

自定义事件解绑

Name Type Description
eventName string

事件名称,resize,hover,drag,etc~

handler function

响应函数

inherited bind(event, handler, context)

mixin/Eventful.js, line 50

绑定事件

Name Type Description
event string

事件名

handler function

事件处理函数

context Object optional

inherited dispatch(type)

mixin/Eventful.js, line 110

事件分发

Name Type Description
type string

事件类型

inherited dispatchWithContext(type)

mixin/Eventful.js, line 156

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

Name Type Description
type string

事件类型

inherited one(event, handler, context)

mixin/Eventful.js, line 24

单次触发绑定,dispatch后销毁

Name Type Description
event string

事件名

handler function

响应函数

context Object

inherited unbind(event, handler)

mixin/Eventful.js, line 75

解绑事件

Name Type Description
event string

事件名

handler function optional

事件处理函数

Events

inherited onclick

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

inherited ondragend

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

inherited ondragenter

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

inherited ondragleave

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

inherited ondragover

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

inherited ondragstart

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

inherited ondrop

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

inherited onmousedown

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

inherited onmousemove

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

inherited onmouseout

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

inherited onmouseover

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

inherited onmouseup

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

inherited onmousewheel

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