作者热门文章
- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我创建了一个混合应用程序,我在其中使用了 bxslider 并将 div 放入其中,如下所示,
<div class="bxslider">
<div id="chart1" style="text-align:center">
<span id="barChartTitle">Bar Chart</span>
<svg id="chartCanvas" class="margintop40"></svg>
</div>
<div id="chart2" style="text-align:center">
<span id="trendChartTitle">Trend Chart</span>
<svg id="chartCanvas" class="margintop40"></svg>
</div>
</div>
每当我在 html View 中触摸 bxslider 时,我都会收到以下错误,
jquery.bxslider.js:1109 Uncaught DOMException: Failed to execute 'setPointerCapture' on 'Element': InvalidPointerId
at HTMLDivElement.onTouchStart (http://localhost:8100/js/jquery.bxslider.js:1109:34)
at HTMLDivElement.dispatch (http://localhost:8100/js/jquery-3.1.1.min.js:3:10315)
at HTMLDivElement.q.handle (http://localhost:8100/js/jquery-3.1.1.min.js:3:8342)
onTouchStart @ jquery.bxslider.js:1109
dispatch @ jquery-3.1.1.min.js:3
q.handle @ jquery-3.1.1.min.js:3
jquery.bxslider.js:1234 Uncaught DOMException: Failed to execute 'releasePointerCapture' on 'Element': InvalidPointerId
at HTMLDivElement.onTouchEnd (http://localhost:8100/js/jquery.bxslider.js:1234:32)
at HTMLDivElement.dispatch (http://localhost:8100/js/jquery-3.1.1.min.js:3:10315)
at HTMLDivElement.q.handle (http://localhost:8100/js/jquery-3.1.1.min.js:3:8342)
查了很多也没有找到错误的原因,求助
最佳答案
这是一个可行的解决方法。使用这段代码:
var chromePointerEvents = typeof PointerEvent === 'function'; if (chromePointerEvents) { if (orig.pointerId === undefined) { return; } }
在之后插入:
touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig];
文件 jquery.bxslider.js
更多信息在这里 read simplicitytrade answer on Github .
关于javascript - DOMException 无法在 'setPointerCapture' 和 'Element' 上执行 'releasePointerCapture',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41541121/
MDN说: The setPointerCapture() method of the Element interface is used to designate a specific elemen
我在弹性盒子里有一堆方形 div 。当我在方 block 内按下鼠标按钮时,我希望目标方 block 的背景发生变化。我想捕获鼠标,因此当我将鼠标移到捕获的方 block 之外并释放鼠标按钮时,背景应
我创建了一个混合应用程序,我在其中使用了 bxslider 并将 div 放入其中,如下所示, Bar Chart
我是一名优秀的程序员,十分优秀!