t***@163.com
t***@163.com
  • 发布:2016-10-27 15:44
  • 更新:2016-10-27 17:07
  • 阅读:2297

为什么我addEventListener 添加tap 监听事件,他就自己调用了

分类:HTML5+
li.addEventListener('tap',takephone(JSON.stringify(phone)));  

这个是写在下拉加载后,请求数据的 回调函数的 for 循环里的 ,目的是为当前cell 添加点击事件 phone 参数是当前 对象。 问题是,我只要下拉加载了 他会自己调用takephone 方法,然后我的cell 点击没反应

2016-10-27 15:44 负责人:无 分享
已邀请:
rodgerz

rodgerz

li.addEventListener('tap',function(){  
    takephone(JSON.stringify(phone));  
});
数字帝国

数字帝国

mui.plusReady(function() {  
                mui('#ul_list').on('tap', '.mui-table-view-cell', function() {  
                    var ii = $(this).index();  
                    switch(ii) {  
                        case 0:  
                            //外勤签到  
                            mui.openWindow("/doMap/OutdoorDatalist.html", "OutdoorDatalist", {  
                                waiting: {  
                                    autoShow: true, //自动显示等待框,默认为true    
                                    //title: '正在加载中···', //等待对话框上显示的提示内容    
                                }  
                            });  
                            break;  
                        case 1:  
                            break  
                        case 2:  
                            break  
                        case 3:  
                            break  
                        case 4:  
                            break  
                        default:  
                            break;  
                    }  

                });  
            });  

下拉刷新---列表 item 点击事件

该问题目前已经被锁定, 无法添加新回复