gpt4 book ai didi

javascript - 如何使用Animated-Multi-level-jQuery-Dropdown-Plugin没有错误?

转载 作者:行者123 更新时间:2023-12-01 05:19:46 25 4
gpt4 key购买 nike

我正在使用 Animated-Multi-level-jQuery-Dropdown-Plugin,但遇到了以下错误:

jquery-1.11.1.min.js:2 Uncaught TypeError: Cannot read property 'length' of undefined at Function.each (jquery-1.11.1.min.js:2) at Dropdown.addItem (jquery.dropdown.js:1274) at Object. (jquery.dropdown.js:1185) at Function.each (jquery-1.11.1.min.js:2) at Dropdown.addItems (jquery.dropdown.js:1183) at Dropdown.addItem (jquery.dropdown.js:1269) at Object. (jquery.dropdown.js:1185) at Function.each (jquery-1.11.1.min.js:2) at Dropdown.addItems (jquery.dropdown.js:1183) at Dropdown._populateList (jquery.dropdown.js:2380)

这是我的代码:

    <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">


<link href="css/jquery.dropdown.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="css/font-awesome.min.css">
</head>

<body role="document">

<div class="container">

<select>
<option>Select Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
</select>

<!-- Html lists -->

<ul>
<li>Item 1</li>
<li data-dropdown-text="Item 2">
<ul>
<li data-dropdown-text="Item 2.1">
<ul>
<li>Item 2.1.1</li>
<li>Item 2.1.2</li>
<li>Item 2.1.3</li>
</ul>
</li>
<li data-dropdown-text="Item 2.2">
<ul>
<li>Item 2.2.1</li>
<li>Item 2.2.2</li>
<li>Item 2.2.3</li>
</ul>
</li>
<li data-dropdown-text="Item 2.3">
<ul>
<li>Item 2.3.1</li>
<li>Item 2.3.2</li>
<li>Item 2.3.3</li>
</ul>
</li>
</ul>
</li>
<li>Item 3</li>
</ul>
</div>



================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="js/jquery.dropdown.js"></script>
<script>

$('select, ul').dropdown();

</script>
<!--<script src="js/bootstrap.min.js"></script>-->

</body>
</html>

请帮帮我,我不知道问题出在哪里?

最佳答案

我遇到了类似的问题,当我将 jQuery 版本更改为 1.12.4 时,问题消失了。

关于javascript - 如何使用Animated-Multi-level-jQuery-Dropdown-Plugin没有错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45661134/

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