$(".mui-card").bind("tap", function() {
mui.toast(this.html());
})
软件提示错误:[ERROR] : TypeError: this.html is not a function. (In 'this.html()', 'this.html' is undefined)
无法使用this关键字,去对打发了事件的元素进行操作,不是只能对每个元素逐一绑定事件去访问和操作它内在的元素
本人测试过有些jq属性方法在app失效,比如scrollTop()获取元素相对运滚动条顶部的距离
请问有没有什么解决办法
2 个回复
王者地带 - 5+混合APP开发教程网 | http://www.html5-app.com | 咨询QQ: 2564034335
把$ 符号换成 jquery 试下, 或者用官方的
mui("body").on("tap",".mui-card", function()
{
mui.toast(this.html());
});
杨婆婆管家家 (作者) - 80后
测试一下把代码修改成这样应该就可以了
或者