[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.
1.滑动时候警告[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.

2.解决方案
解决办法1:
在touch的事件监听方法上绑定第三个参数{ passive: false },
通过传递 passive 为 false 来明确告诉浏览器:事件处理程序调用 preventDefault 来阻止默认滑动行为。
elem.addEventListener(
'touchstart',
fn,
{ passive: false }
);
解决办法2:
* { touch-action: pan-y; }
// 使用全局样式样式去掉
.
[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.的更多相关文章
- 移动端页面滑动时候警告:Unable to preventDefault inside passive event listener due to target being treated as passive.
移动端项目中,在滚动的时候,会报出以下提示: [Intervention] Unable to preventDefault inside passive event listener due to ...
- Unable to preventDefault inside passive event listener due to target being treated as passive
Unable to preventDefault inside passive event listener due to target being treated as passive 今天在做项目 ...
- IScroll Unable to preventDefault inside passive event listener due to target being treated as passive
最近两天企业微信下IScroll突然无法滚动了,特别慢,之前好好的,发现主要是有红色的Unable to preventDefault inside passive event listener du ...
- [Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080
相信如果用谷歌浏览器做移动端页面的时候 用touch事件的时候应该遇到过这个东东吧 documet.addEventListener("touchstart",function() ...
- Vue移动端报错[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.
解决方法如下 项目方案: 在最外侧添加样式操作 .
- 关于Google浏览器Unable to preventDefault inside passive event listener due to target being treated as passive.的解决方案
最近写react项目的时候,引用了antd-mobile,在使用滚动组件的时候,发现谷歌浏览器会报以下警告 最初我以为是antd-mobile的问题导致的,然后我就无查看了之前的vue的项目,发现了类 ...
- Unable to preventDefault inside passive event listener due to target being treated as passive 怎么办?
本篇为转载,原文链接:https://blog.csdn.net/lijingshan34/article/details/88350456 翻译一下:chrome 监听touch类事件报错:无法被动 ...
- Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080
解决办法: 两个方案:1.注册处理函数时,用如下方式,明确声明为不是被动的window.addEventListener('touchmove', func, { passive: false }) ...
- Unable to preventDefault inside passive event listener due to target being treated as passive?
使用滚动时候,新版google浏览器,会弹出如下的警告. 解决方法,可以加上* { touch-action: none; } 这句样式去掉. 其原因:https://developers.googl ...
随机推荐
- seneca的一段代码(原创)
var seneca=require('seneca')() seneca.add({cmd:'wordcount'},function(msg,respond){ var length=0; if( ...
- webloader上传图片详细教程/使用thinkphp5.0(原创)
这个插件对后端程序员相当友好,无论是JAVA还是PHP,抑或python,基本只需要一句代码就能完成上传并且预览的效果,先上效果图,让你们眼馋一下 废话不说,直接撸代码,前端代码如下: <htm ...
- Cookie 的运用
Cookie的原理是通过Set-Cookie响应头和Cookie请求头将会话中产生的数据保存在客户端.--- 底层(SUN公司已经给我们提供了一套API) Cookie是将需要保存的数据保存在了客户端 ...
- [ThinkPHP] 从一个表中获得栏目对应的ID,从另一个表获得属于这些栏目的文章
public function index(){ $cate = 1; $query = M('Cate')->field('id')->where(array('id'=>$cat ...
- ipython notebook install
1.python install (ubuntut系统默认2.7.x) Github: https://github.com/ipython/ipython 2.sudo apt-get instal ...
- git log 查看某文件的修改历史
先进入此文件所在的目录下 1. git log --help 所有的git命令都可以通过git manual查看 在synopsis中可以看到公式 git log [<options>] ...
- 某道我xjb想的题
Function 时限:5s 空限:256M (都是单点) Discription 现在你有一个函数: inline int f(int x){ int tot=0,alr=0,now; while( ...
- hadoop map(分片)数量确定
之前学习hadoop的时候,一直希望可以调试hadoop源码,可是一直没找到有效的方法,今天在调试矩阵乘法的时候发现了调试的方法,所以在这里记录下来. 1)事情的起因是想在一个Job里设置map的数量 ...
- android出现段错误时的查找定位的方法
android出现段错误时的查找方法,例如出现log: - ::): Fatal signal (SIGSEGV) at ), thread (SurfaceFlinger) - ::): *** * ...
- NEXUS7 学习
一.编译环境搭建 (更细节的环境搭建请参考:How to Build CyanogenMod for Nexus 7 (Wi-Fi, 2012 version) (codename: grouper) ...