简体   繁体   English

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

[英]How to use Animated-Multi-level-jQuery-Dropdown-Plugin no errors?

I'm using Animated-Multi-level-jQuery-Dropdown-Plugin and i encountered the following errors: 我正在使用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-1.11.1.min.js:2未捕获的TypeError:无法读取Dropdown.addItem(jquery.dropdown.js :)在Function.each(jquery-1.11.1.min.js:2)上未定义的属性'length' 1274)。 (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. (Function.each(jquery-1.11.1.min.js:2)在Dropdown.addItems(jquery.dropdown.js:1183)在Function.each(jquery.dropdown.js:1185)在Dropdown.addItem(jquery.dropdown.js: 1269)。 (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) (jquery.dropdown.js:1185)在Function.each(jquery-1.11.1.min.js:2)在Dropdown.addItems(jquery.dropdown.js:1183)在Dropdown._populateList(jquery.dropdown.js: 2380)

this is my code: 这是我的代码:

    <!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>

please help me I do not know where the problem is? 请帮我,不知道问题出在哪里?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM