{ 整个代码如下所示 document.addEventListener( -6ren">
gpt4 book ai didi

javascript - mmenu IE11问题

转载 作者:行者123 更新时间:2023-12-03 08:33:48 25 4
gpt4 key购买 nike

我只是使用mmenu脚本,并且在此行中收到IE11语法错误。

    "DOMContentLoaded", () => {
整个代码如下所示
document.addEventListener(
"DOMContentLoaded", () => {
new Mmenu( "#my-menu" );
}
);
代码不在官方文档中-> https://mmenujs.com/docs/core/
enter image description here
enter image description here
我尝试了一些用function()等找到的不同解决方案。
但是他们都不为我工作。
也许其他人遇到了这个问题,可以帮助我。
更新:
现在我得到 对象不支持IE11上的属性或方法'append'
document.addEventListener("DOMContentLoaded", function() {

new Mmenu( "#menu", {
"extensions": [
"pagedim-black",
"position-right"
],
navbar : {
title : " "
},
"navbars": [
{
"position": "top",
"content": [
"prev",
"title"
]
},
{
"position": "bottom",
"content": [
"<div class='navshort'></div>",
]
}
]
});

} );

最佳答案

根据mmenu文档https://mmenujs.com/docs/

As of version 8, the mmenu.js plugin by default only supports ECMAScript 6 compliant browsers. For Internet Explorer 10 and 11, you'll need the JavaScript polyfills included in the package.

Version 7 should work in Internet Explorer 10 and 11 without any shortcomings, it should also work to some degree in Internet Explorer 9, but you'll need a matchMedia polyfill.


对于IE 10和11,您需要使用polyfills

关于javascript - mmenu IE11问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64150229/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com