fix: 导航栏中没有active菜单时客户端脚本出错
#Comment 菜单动画效果失败导致,无法计算 $navItem.offset().top
This commit is contained in:
parent
84ae63acc4
commit
fc0d7fb013
|
@ -145,7 +145,7 @@ $(function () {
|
|||
autoScrollSidebar: function (options) {
|
||||
var option = $.extend({ target: null, offsetTop: 0 }, options);
|
||||
var $navItem = option.target;
|
||||
if ($navItem === null) return this;
|
||||
if ($navItem === null || $navItem.length === 0) return this;
|
||||
|
||||
// sidebar scroll animate
|
||||
var middle = this.outerHeight() / 2;
|
||||
|
|
Loading…
Reference in New Issue