div.addEventListener('touchstart',function(e){ console.log("内部定义的:touchstart"); console.log(e.target.textContent); this.style.backgroundColor = "#6BADCA"; this.style.borderColor = "#fff"; //边框颜色 })
我在移动端使用了百度地图,给地图添加了click事件,跳转新页面。在网页端测试时完全没有问题,但是在移动端点击却没有反应。如果用touch事件的画整个地图的拖动缩放都不能用了,直接一接触地图就跳转了map.addEventListener("click", function(e){ //点击事件 window.location.href='./test.html';
});找了半天资料没看到相似情况。不知道该怎么解决。我想在移动端实现点击click事件。不影响地图的所有功能。现在只用map.disableDragging();才能触发click事件,但是等于说