()
| 180 | |
| 181 | //绑定点击事件 |
| 182 | function bindEvents() { |
| 183 | var child = $("ul#sidebar-menu>li.treeview>ul>li"); |
| 184 | var parent = $('ul.sidebar-menu>li').parent("ul"); |
| 185 | //因为iManager只有1级所以,iManager点击的时候相当于一级菜单,其他的二级都要关闭. |
| 186 | if ($('ul.sidebar-menu>li#firstMenuiManager').find('ul').length == 0) { |
| 187 | if ($('ul.sidebar-menu>li#firstMenuiManager').click(function () { |
| 188 | $('ul#sidebar-menu>li>ul').slideUp(500); |
| 189 | })); |
| 190 | } |
| 191 | //一级菜单跳转 |
| 192 | child.parent('ul').siblings('a').click(function (evt) { |
| 193 | if ($(this).siblings('ul').is(':visible') && $(this).siblings('ul').children('li').hasClass('active')) { |
| 194 | evt.stopPropagation(); //阻止点击事件触发折叠的冒泡 |
| 195 | } |
| 196 | window.location = evt.currentTarget.href; |
| 197 | }); |
| 198 | |
| 199 | //二级菜单跳转,不用 boot自带 |
| 200 | window.addEventListener("hashchange", function () { |
| 201 | scroll(); |
| 202 | }); |
| 203 | } |
| 204 | |
| 205 | var openTimer; // 定义展开的延时 |
| 206 | var animationSpeed = 500; |
no test coverage detected