Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

感觉 selector 绑定 function 的 this 指向不合理 #21

Open
webMagicX opened this issue Jan 4, 2016 · 0 comments
Open

感觉 selector 绑定 function 的 this 指向不合理 #21

webMagicX opened this issue Jan 4, 2016 · 0 comments

Comments

@webMagicX
Copy link

<div id="selector"><h3>标题</h3><p>描述</p></div>

touch.bind("#selector", "tap", function(){
//点击标题
console.log(this); // this -> <h3>标题</h3>
});
这个结果明显不是想要的

var e = d.call(a.target, a);

还有一个小小的问题,手册说:
touch.trigger(element, type)
element element或string 元素对象或选择器

并不能接收 string,只能接收 element

try {
"undefined" != typeof CustomEvent ? (d = new CustomEvent(b, e), a && a.dispatchEvent(d)) : (d = document.createEvent("CustomEvent"), d.initCustomEvent(b, !0, !0, c), a && a.dispatchEvent(d))
} catch(f) {
console.warn("Touch.js is not supported by environment.")
}
明显没有处理

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant