1

I have a partial view and I have a list of Categories but I want to use the jqWidget menu, I have make the references

<link rel="stylesheet" href="../../Content/jqwidgets/styles/jqx.base.css" type="text/css" />
  <link rel="stylesheet" href="../../Content/jqwidgets/styles/jqx.base.css" type="text/css"/>
<script type="text/javascript" src="../../Scripts/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="../../Content/scripts/gettheme.js"></script>
<script type="text/javascript" src="../../Content/jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../Content/jqwidgets/jqxmenu.js"></script>
<script type="text/javascript" src="../../Content/jqwidgets/jqxcheckbox.js"></script>
<link rel="stylesheet" href="../../Content/jqwidgets/styles/jqx.fresh.css" type="text/css" />

But they just show like normal li tags, I am using MVC 4, here is the rest of the code:

<body>
    <div id='content'>
        <script type="text/javascript">
            $(document).ready(function () {

                $("#Menu").jqxMenu({ mode: 'vertical', theme: 'fresh' });
                $("#Menu").css('visibility', 'visible');
            });
        </script>
        <div id='Menu'>
            <div >
                <ul>

                    @foreach (var category in Model)
                    {
                        <li>
                            <a>@Html.ActionLink(category.Name, "Browse", "Store", new { Category = category.Name }, null)</a>
                        </li>
                    }
                </ul>
            </div>
        </div>
    </div>

</body>   
4

2 回答 2

0

据我说,HTML结构不正确。菜单需要 DIV 标签下方的 UL 标签,这里有 2 个嵌套的 DIV 标签。

于 2013-10-03T06:16:02.920 回答
0

我找到了解决方案,似乎 _layout 页面没有加载引用,所以我在每个视图中都包含了引用,它现在可以工作了。

于 2013-10-03T14:42:44.650 回答