Namespace: Event

Event

事件处理函数.

Members

staticSuperMap.Event.KEY_BACKSPACEnumber

KEY_BACKSPACE

Default Value:
  • 8

staticSuperMap.Event.KEY_DELETEnumber

KEY_DELETE

Default Value:
  • 46

staticSuperMap.Event.KEY_DOWNnumber

KEY_DOWN

Default Value:
  • 40

staticSuperMap.Event.KEY_ESCnumber

KEY_ESC

Default Value:
  • 27

staticSuperMap.Event.KEY_LEFTnumber

KEY_LEFT

Default Value:
  • 37

staticSuperMap.Event.KEY_RETURNnumber

KEY_RETURN

Default Value:
  • 13

staticSuperMap.Event.KEY_RIGHTnumber

KEY_RIGHT

Default Value:
  • 39

staticSuperMap.Event.KEY_SPACEnumber

KEY_SPACE

Default Value:
  • 32

staticSuperMap.Event.KEY_TABnumber

KEY_TAB

Default Value:
  • 9

staticSuperMap.Event.KEY_UPnumber

KEY_UP

Default Value:
  • 38

staticSuperMap.Event.observersBoolean

A hashtable cache of the event observers. Keyed by element._eventCacheID

Default Value:
  • false

Methods

staticSuperMap.Event.element(event){HTMLElement}

common/commontypes/Event.js, line 95

Cross browser event element detection.

Name Type Description
event Event

-

Returns:
Type Description
HTMLElement The element that caused the event

staticSuperMap.Event.findElement(event, tagName){HTMLElement}

common/commontypes/Event.js, line 164
Name Type Description
event Event

-

tagName string

html标签名

Returns:
Type Description
HTMLElement The first node with the given tagName, starting from the node the event was triggered on and traversing the DOM upwards

staticSuperMap.Event.isLeftClick(event){Boolean}

common/commontypes/Event.js, line 122

Determine whether event was caused by a left click.

Name Type Description
event Event

-

Returns:
Type Description
Boolean

staticSuperMap.Event.isMultiTouch(event){Boolean}

common/commontypes/Event.js, line 113

Determine whether event was caused by a multi touch

Name Type Description
event Event

-

Returns:
Type Description
Boolean

staticSuperMap.Event.isRightClick(event){Boolean}

common/commontypes/Event.js, line 132

Determine whether event was caused by a right mouse click.

Name Type Description
event Event

-

Returns:
Type Description
Boolean

staticSuperMap.Event.isSingleTouch(event){Boolean}

common/commontypes/Event.js, line 104

Determine whether event was caused by a single touch

Name Type Description
event Event

-

Returns:
Type Description
Boolean

staticSuperMap.Event.observe(elementParam, name, observer, useCapture)

common/commontypes/Event.js, line 180

监听事件,注册事件处理方法。

Name Type Description
elementParam HTMLElement | string

待监听的DOM对象或者其id标识。

name string

监听事件的类别名称。

observer function

注册的事件处理方法。

useCapture Boolean

是否捕获。

staticSuperMap.Event.stop(event, allowDefault)

common/commontypes/Event.js, line 142

Stops an event from propagating.

Name Type Description
event Event

-

allowDefault Boolean

If true, we stop the event chain but still allow the default browser behaviour (text selection, radio-button clicking, etc) Default false

staticSuperMap.Event.stopObserving(elementParam, name, observer, useCapture){Boolean}

common/commontypes/Event.js, line 265

移除事件监听和注册的事件处理方法。注意:事件的移除和监听相对应,移除时的各属性信息必须监听时 保持一致才能确保事件移除成功。

Name Type Description
elementParam HTMLElement | string

被监听的DOM元素或者其id。

name string

需要移除的被监听事件名称。

observer function

需要移除的事件处理方法。

useCapture Boolean

是否捕获。

Returns:
Type Description
Boolean Whether or not the event observer was removed

staticSuperMap.Event.stopObservingElement(elementParam)

common/commontypes/Event.js, line 234

Given the id of an element to stop observing, cycle through the element's cached observers, calling stopObserving on each one, skipping those entries which can no longer be removed.

Name Type Description
elementParam HTMLElement | string

-

staticSuperMap.Event.unloadCache()

common/commontypes/Event.js, line 318

Cycle through all the element entries in the events cache and call stopObservingElement on each.