javascript - querySelectorAll/forEach 在 IE11 中不起作用
问题描述
尝试制作一些易于使用的卡片,但在 IE11 上遇到问题(不足为奇)。很确定我错过了一些明显的东西?我知道这是 js 的问题,但大脑无法正常工作:/
const cards = document.querySelectorAll('.card');
Array.prototype.forEach.call(cards, card => {
let down, up, link = card.querySelector('h4 a');
card.style.cursor = 'pointer';
card.onmousedown = () => down = +new Date();
card.onmouseup = () => {
up = +new Date();
if ((up - down) < 200) {
link.click();
}
}
});
解决方案
推荐阅读
- salesforce - DocuSign for Salesforce URL 按钮中的撇号
- javascript - MomentJs 给出错误的月份
- unit-testing - Testhost.exe 已退出,代码为 -1 (0xffffffff)
- python - AttributeError:模块没有属性,同时避免循环引用错误
- html - CSS - 在三列中对齐 div 元素
- opencv - 使用 Opencv 进行 Python 多线程视频处理 - 停止视频后 setMouseCallback 不起作用
- c# - 添加具有对旧核心项目的核心引用的 nuget
- c++ - 来自 Boost.org 的 Boost Log 1.65.0 示例的链接错误
- exchangewebservices - EWS 请求在 Mac 上没有响应并出现错误
- arduino - 草图代码中可用的 Arduino 草图名称