Class: Gesture

Ycc. Gesture

new Ycc.Gesture(option)

Name Type Description
option
Name Type Description
target 手势触发的HTML对象
useMulti boolean 是否启用多点触控。对于无多点触控的项目,关闭多点触控,可节省性能消耗。默认启用

Extends

Members

disableTypeObject

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

listenersObject

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

onclickfunction

点击 的监听。默认为null

ondragendfunction

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

ondraggingfunction

拖拽 的监听。默认为null

ondragstartfunction

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

onmousedownfunction

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

onmousemovefunction

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

onmouseoutfunction

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

onmouseoverfunction

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

onmouseupfunction

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

ontapfunction

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

ontouchendfunction

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

ontouchmovefunction

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

ontouchstartfunction

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

optionObject

stopAllEventboolean

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

stopTypeObject

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

Methods

inherited addListener(type, listener)

添加某个类型的监听器
Name Type Description
type string
listener function
禁止某个事件触发
Name Type Description
type

enableMutiTouch(enable)

设置是否启用多点触控
Name Type Description
enable

inherited removeListener(type, listener)

移除某个类型的监听器
Name Type Description
type
listener
恢复某个事件的触发
Name Type Description
type
阻止某个事件类型继续传递
Name Type Description
type

inherited triggerListener(type, data)

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