Class: TouchLifeTracer

Ycc. TouchLifeTracer

new Ycc.TouchLifeTracer(opt)

touch事件追踪器
Name Type Description
opt
Name Type Description
target 被追踪的dom对象

Extends

Members

_lifeList

作用于target的所有生命周期,包含存活和死亡的周期

changedTouchesArray

当前改变的所有touch

currentLifeList

当前存活的生命周期,正在与target接触的触摸点生命周期

disableTypeObject

被禁用的事件类型。key为type,val为boolean

listenersObject

所有的监听器。key为type,val为listener数组。

onclickfunction

点击 的监听。默认为null

ondragendfunction

拖拽结束 的监听。默认为null

ondraggingfunction

拖拽 的监听。默认为null

ondragstartfunction

拖拽开始 的监听。默认为null

onlifechangefunction

某个生命周期状态变更

onlifeendfunction

某个生命周期开始

onlifestartfunction

某个生命周期开始

onmousedownfunction

鼠标按下 的监听。默认为null

onmousemovefunction

鼠标移动 的监听。默认为null

onmouseoutfunction

鼠标移出 的监听。默认为null

onmouseoverfunction

鼠标移入 的监听。默认为null

onmouseupfunction

鼠标抬起 的监听。默认为null

ontapfunction

点击事件 的监听。默认为null

ontouchendfunction

触摸结束 的监听。默认为null

ontouchmovefunction

触摸移动 的监听。默认为null

ontouchstartfunction

触摸开始 的监听。默认为null

stopAllEventboolean

只会阻止当前UI事件的触发,不会阻止其下面子元素事件的触发

stopTypeObject

被阻止的事件类型。key为type,val为boolean

target

追踪的对象

targetTouchesArray

当前对象的touch

touchesArray

当前target所有的touch

Methods

添加生命周期
Name Type Description
life TouchLife 生命周期
Returns:
Type Description
*

inherited addListener(type, listener)

添加某个类型的监听器
Name Type Description
type string
listener function

deleteCurrentLifeByTouchID(identifier){boolean}

根据touchID删除当前触摸的生命周期
Name Type Description
identifier
Returns:
Type Description
boolean
禁止某个事件触发
Name Type Description
type

findCurrentLifeByTouchID(identifier){*}

根据identifier查找生命周期,此方法只能在生命周期内使用
Name Type Description
identifier
Returns:
Type Description
*

indexOfTouchFromMoveTouchEventList()

寻找移动过的接触点
初始化

inherited removeListener(type, listener)

移除某个类型的监听器
Name Type Description
type
listener
恢复某个事件的触发
Name Type Description
type
阻止某个事件类型继续传递
Name Type Description
type
同步当前HTML元素的touches
Name Type Description
e 原生的touch事件。touchstart、end、move ...

inherited triggerListener(type, data)

触发某一类型的监听器
Name Type Description
type
data