fix: 导航栏中没有active菜单时客户端脚本出错

#Comment
菜单动画效果失败导致,无法计算 $navItem.offset().top
This commit is contained in:
Argo-MacBookPro 2019-06-23 19:50:03 +08:00
parent 84ae63acc4
commit fc0d7fb013
No known key found for this signature in database
GPG Key ID: E7A1100ED46755F1
1 changed files with 1 additions and 1 deletions

View File

@ -145,7 +145,7 @@ $(function () {
autoScrollSidebar: function (options) { autoScrollSidebar: function (options) {
var option = $.extend({ target: null, offsetTop: 0 }, options); var option = $.extend({ target: null, offsetTop: 0 }, options);
var $navItem = option.target; var $navItem = option.target;
if ($navItem === null) return this; if ($navItem === null || $navItem.length === 0) return this;
// sidebar scroll animate // sidebar scroll animate
var middle = this.outerHeight() / 2; var middle = this.outerHeight() / 2;