<link href="@Url.Content("~/Content/kendo/2014.1.318/kendo.common.min.css")" rel="stylesheet" type="text/css" /> <link href="@Url.Content("~/Content/kendo/2014.1.318/kendo.default.min.css")" rel="stylesheet" type="text/css" /> <script src="@Url.Content("~/Scripts/kendo/2014.1.318/jquery.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/kendo/2014.1.318/kendo.web.min.js")" type="text/javascript"></script>
<ul id="panelbar"> <li> <h2>Season</h2> <div> <ul> <li>Spring</li> <li>Summer</li> <li>Autumn</li> <li>Winter</li> </ul> </div> </li> <li class="k-state-active"> <h2>Weekday</h2> <div> <ul> <li> Sunday</li> <li>Monday</li> <li> Tuesday</li> <li>Wednesday</li> <li>Thursday</li> <li>Friday</li> <li>Saturday</li> </ul> </div> </li> <li> <h2>Direction</h2> <div> <ul> <li>East</li> <li>South</li> <li>West</li> <li>North</li> </ul> </div> </li> </ul>
<script type="text/javascript"> $(function () { $("#panelbar").kendoPanelBar({ expandMode: "single" // 設定展開模式只能展開單個 }); }); </script>
效果預覽:
說明:將需要展開項中的class設定為k-state-active即可在載入完成時預設展開。