动态加载的元素无法绑定事件时:
$(function() {
$(".已经在页面,元素的父容器").on('tap', '.想要绑定事件的标签', function(e) {
//取消冒泡
var e = e || window.event;
e.stopPropagation();
dosomething(){.....}
})
})
动态加载的元素无法绑定事件时:
$(function() {
$(".已经在页面,元素的父容器").on('tap', '.想要绑定事件的标签', function(e) {
//取消冒泡
var e = e || window.event;
e.stopPropagation();
dosomething(){.....}
})
})
转载于:https://my.oschina.net/Cubicluo/blog/776191