diff --git a/template/css/site.less b/template/css/site.less index 183b3ba3ed..c33202be85 100644 --- a/template/css/site.less +++ b/template/css/site.less @@ -45,6 +45,9 @@ nav .logo { -moz-user-select: none; -ms-user-select: none; user-select: none; + width: 100%; + text-overflow: ellipsis; + overflow: hidden; } span::before { @@ -74,6 +77,7 @@ nav .logo { & > nav nav { display: none; overflow: hidden; + max-width: 100%; } &.show { diff --git a/template/js/site.js b/template/js/site.js index c6a81501dc..6f07f73b23 100644 --- a/template/js/site.js +++ b/template/js/site.js @@ -13,18 +13,21 @@ $(function () { }); }); //根据网址自动展开到对应目录 -$(function () { +var cachedOnload = window.onload; +window.onload = function () { + cachedOnload(); var pathName = decodeURI(location.pathname); var link = $(".catalog").find("[href='" + pathName + "']")[0]; $(link).addClass("active"); - $(link).parents().show(); + $(link).parents("nav").show("fast"); $(link).parents().prev().addClass('expand'); //导航栏高亮 var href = pathName.split('/')[1]; $(".navbar-nav [href='/" + href + "']").each(function () { $(this).addClass("active"); }); -}); +}; + //懒加载 $(function () { $('[data-original]').lazyload({ diff --git a/template/template.html b/template/template.html index 2928f562f1..27137a31af 100644 --- a/template/template.html +++ b/template/template.html @@ -29,7 +29,7 @@