new Ycc.TouchLifeTracer(opt)
touch事件追踪器
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
opt |
|
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
-
addLife(life){*}
-
添加生命周期
Name Type Description lifeTouchLife 生命周期 Returns:
Type Description * -
inherited addListener(type, listener)
-
添加某个类型的监听器
Name Type Description typestring listenerfunction -
deleteCurrentLifeByTouchID(identifier){boolean}
-
根据touchID删除当前触摸的生命周期
Name Type Description identifierReturns:
Type Description boolean -
inherited disableEvent(type)
-
禁止某个事件触发
Name Type Description type -
findCurrentLifeByTouchID(identifier){*}
-
根据identifier查找生命周期,此方法只能在生命周期内使用
Name Type Description identifierReturns:
Type Description * -
indexOfTouchFromMoveTouchEventList()
-
寻找移动过的接触点
-
init()
-
初始化
-
inherited removeListener(type, listener)
-
移除某个类型的监听器
Name Type Description typelistener -
inherited resumeEvent(type)
-
恢复某个事件的触发
Name Type Description type -
inherited stop(type)
-
阻止某个事件类型继续传递
Name Type Description type -
syncTouches(e)
-
同步当前HTML元素的touches
Name Type Description e原生的touch事件。touchstart、end、move ... -
inherited triggerListener(type, data)
-
触发某一类型的监听器
Name Type Description typedata