我是MVC的新手,正打算使用手风琴。当我尝试为jquery手风琴添加所有引用并创建div时,手风琴不存在/出现。

这是我的代码。

@{
    ViewBag.Title = "Online Coach Tracker | Workforce Reporting and Business     Intelligence";
}

<html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <link rel="stylesheet" href="../../development-bundle/themes/base/jquery.ui.all.css">
        <script src="../../js/jquery-1.10.2.js"></script>
        <script src="../../development-bundle/ui/jquery.ui.core.js"></script>
        <script src="../../development-bundle/ui/jquery.ui.widget.js"></script>
        <script src="../../development-bundle/ui/jquery.ui.accordion.js"></script>
        <link rel="stylesheet" href="../../development-bundle/demos/demos.css">
        <script>
            $(function () {
                $("#accordion").accordion({
                    collapsible: true
                });
            });
        </script>
    </head>
    <body>
        <div id="accordion">
            <h1><a href="#1">Section 1</a></h1>
            <div>In section 1</div>

            <h1><a href="#2">Section 2</a></h1>
            <div>In section 2</div>
        </div>
    </body>
</html>


提前致谢!。

最佳答案

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title></title>
  <link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css"/>
  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
  <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
  <script>
            $(function () {
                $("#accordion").accordion({
                    collapsible: true
                });
            });
  </script>
</head>
<body>
    <div id="accordion">
        <h1><a href="#1">Section 1</a></h1>
         <div>In section 1</div>

         <h1><a href="#2">Section 2</a></h1>
         <div>In section 2</div>
    </div>
</body>
</html>


您也可以在此处检查代码:http://jsfiddle.net/aaa_borza/FDdLL/4/

07-24 16:46