/**
* vnode type String HTMLDivElement 触发对象
* direction type String : left top right bottom 触发方向
* fn type function 回调函数
* mode type Boolean : false 结束触发 true 连续触发
*
* objFun.objFun.onTouch(dom:String/HTMLDivElement,触发方向:String,回调函数:function,模式:Boolean)
*
*/
class yd {
constructor() {
}
onTouch(
vnode,
direction,
fn = function () {
console.log("未添加事件");
},
mode = false
) {
let _that = {
};
if (Object.prototype.toString.call(vnode) == "[object HTMLDivElement]") {
_that.vn = vnode;
} else if (Object.prototype.toString.call(vnode) == "[object String]") {
_that.vn = document.querySelector(vnode);
}
_that