【网寻】mui - 点击事件

 

 

 

//本来是需要这样的,结果点击无响应
$(".mui-control-item").on("click",function(event){
    alert(1)
});
    
//换成以下就可以了,$(".top-menu-list") 为本来的事件源的父级,此父级需要是一开始就存在的dom结构,而非动态添加        
$(".top-menu-list").on("tap",".mui-control-item",function(event){
    alert(1)
});

 

//如果是 a 点击无效,用以下方法试试
mui('body').on('tap', 'a', function() {                                        
        window.top.location.href = this.href;
});

 

posted @ 2018-07-26 17:46  前端开发小姐姐  阅读(7223)  评论(0编辑  收藏  举报