2***@qq.com
2***@qq.com
  • 发布:2022-11-03 17:52
  • 更新:2022-11-03 17:52
  • 阅读:151

nativeObj 的 view 有时监听不到 touchend事件

分类:HTML5+
view.addEventListener('touchend', (e) => {  
    let x = e.screenX  
    let y = e.screenY  
    let halfWidth = windowWidth / 2  
    let popupStyle = {  
        top: y + "px",  
        width: "50px",  
        height: "50px"  
    }  

    if (x < halfWidth ) {  
        popupStyle.left = '0px'  
    } else {  
        popupStyle.left = (windowWidth - 50) + 'px'  
    }  
    view.setStyle(popupStyle)  
})  

这个touchend 经常不会被回调,这个怎么回事

2022-11-03 17:52 负责人:无 分享
已邀请:

要回复问题请先登录注册