Skip to content

Commit 79698b7

Browse files
author
黄佰荣
committed
添加导航
1 parent 1cf4b33 commit 79698b7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

docs/static/web.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@ jQuery(function($) {
22
submenu_init();
33
});
44

5-
// mobile 二级目录的点击功能
5+
// 二级目录的点击功能
66
function submenu_init() {
77
// 判断当前屏幕
88
jQuery('#example-navbar-collapse li.li-sub').click(function (event) {
99
event.stopPropagation(); // 阻止事件冒泡
1010
let ele = jQuery(this).find('.submenu');
11+
12+
// 第一次点击需要显示(因为存在兼容性BUG)
13+
if(!ele.data('click_first')){
14+
ele.show();
15+
ele.data('click_first',true)
16+
return true;
17+
}
18+
19+
console.log(ele.data('click_first'));
1120
// 判断显示隐藏
1221
if (ele.is(':visible')) {
1322
ele.hide();

0 commit comments

Comments
 (0)