這篇文章帶給大家的內容是關於jquery中如何實現菜單的展開和折疊(程式碼),有一定的參考價值,有需要的朋友可以參考一下,希望對你有幫助。
jquery內容
<script> $(function () { $("dl dt").click(function () { $(this).siblings().toggle().parent().siblings().children("dd").hide(); }); }); </script>
#標籤內容##
<dl id="ctl00_menuPassMgr"> <dt><span> <img alt="" src='images/ico03.gif' /> </span> <span> <a href="javascript:">密码管理</a></span> </dt> <dd> <span> <img alt="" src='images/ico06.gif' /></span> <span> <a href='/SysManager/ChangePassword.aspx'>修改密码</a></span> </dd> </dl> <dl id="ctl00_menuHourse"> <dt><span> <img alt="" src='images/ico03.gif' /></span> <span><a href="javascript:">宿舍管理</a></span> </dt> <dd> <span> <img alt="" src='images/ico06.gif' /></span> <span><a href='/SchoolHourseManager/SchoolHourseList.aspx'> 学生宿舍查询</a></span> </dd> <dd> <span> <img alt="" src='images/ico06.gif' /></span> <span><a href='/SchoolHourseManager/SchoolHourseEdit.aspx'> 学生宿舍新增</a></span> </dd> <dd> <span> <img alt="" src='images/ico06.gif' /></span> <span><a href='/SchoolHourseManager/CheckStudentDormitory.aspx'> 学生宿舍分配</a></span> </dd> </dl> <dl id="ctl00_menuStudent"> <dt><span> <img alt="" src='images/ico03.gif' /></span> <span><a href="javascript:">学生管理</a></span> </dt> <dd> <span> <img alt="" src='images/ico06.gif' /></span> <span><a href='/StudentManager/StudentList.aspx'> 学生信息列表</a></span> </dd> <dd> <span> <img alt="" src='images/ico06.gif' /></span> <span><a href='/StudentManager/StudentEdit.aspx'> 学生信息新增</a></span> </dd> <dd> <span> <img alt="" src='images/ico06.gif' /></span> <span><a href='/ClassManager/ClassList.aspx'> 班级信息列表</a></span> </dd> <dd> <span> <img alt="" src='images/ico06.gif' /></span> <span><a href='/ClassManager/ClassEdit.aspx'> 班级信息新增</a></span> </dd> </dl> <dl id="ctl00_menuTeacher"> <dt><span> <img alt="" src='images/ico03.gif' /></span> <span><a href="javascript:">教师管理</a></span> </dt> <dd> <span> <img alt="" src='images/ico06.gif' /></span> <span><a href='/TeacherManager/TeacherEdit.aspx'> 教师入职登记</a></span> </dd> <dd> <span> <img alt="" src='images/ico06.gif' /></span> <span><a href='/TeacherManager/TeacherList.aspx'> 教师信息查询</a></span> </dd> </dl> <dl id="ctl00_menuReport"> <dt><span> <img alt="" src='images/ico03.gif' /></span> <span><a href="javascript:">缴费及统计报表</a></span> </dt> <dd> <span> <img alt="" src='images/ico06.gif' /></span> <span><a href='/TeacherManager/TeacherList.aspx'> 学生缴费入口</a></span> </dd> <dd> <span> <img alt="" src='images/ico06.gif' /></span> <span><a href='/TeacherManager/TeacherList.aspx'> 学生缴费查询</a></span> </dd> <dd> <span> <img alt="" src='images/ico06.gif' /></span> <span><a href='/TeacherManager/TeacherList.aspx'> 收件信息查看</a></span> </dd> <dd> <span> <img alt="" src='images/ico06.gif' /></span> <span><a href='/TeacherManager/TeacherList.aspx'> 发件信息查看</a></span> </dd> </dl>
jQuery 簡單又漂亮的導覽選單_html/css_WEB-ITnose
#jQuery EasyUI 選單與按鈕之創建簡單的選單和連結按鈕_jquery
以上是jquery中如何實現選單的展開與折疊(程式碼)的詳細內容。更多資訊請關注PHP中文網其他相關文章!