修改BUG:配置的菜单与地址可能不一致,导致面包屑导航条多了一个斜杠
This commit is contained in:
parent
453df71404
commit
702912d1c8
|
@ -21,9 +21,7 @@
|
||||||
|
|
||||||
// breadcrumb
|
// breadcrumb
|
||||||
var arch = $('#nav-accordion').find('a.active').last();
|
var arch = $('#nav-accordion').find('a.active').last();
|
||||||
var breadcrumb = arch.text();
|
$breadNav.text(arch.text());
|
||||||
if (breadcrumb === "") $breadNav.hide();
|
|
||||||
else $breadNav.text(breadcrumb);
|
|
||||||
var top = arch.offset().top;
|
var top = arch.offset().top;
|
||||||
if (top > $sidebar.height()) $sidebar.animate({ scrollTop: top + 300 - $sidebar.height() }, 800);
|
if (top > $sidebar.height()) $sidebar.animate({ scrollTop: top + 300 - $sidebar.height() }, 800);
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
function setActive(ele) {
|
function setActive(ele) {
|
||||||
ele.addClass('active');
|
ele.addClass('active');
|
||||||
ele.parents("ul").first().find('p').addClass('active');
|
ele.parents("ul").first().find('p').addClass('active');
|
||||||
var breadcrumb = ele.text();
|
$breadNav.text(ele.text()).show();
|
||||||
if (breadcrumb === "") $breadNav.hide();
|
|
||||||
else $breadNav.text(breadcrumb);
|
|
||||||
}
|
}
|
||||||
$('#navbar').attr('data-toggle', "dropdown").addClass('dropdown-toggle');
|
$('#navbar').attr('data-toggle', "dropdown").addClass('dropdown-toggle');
|
||||||
var $subMenu = $('#submenu');
|
var $subMenu = $('#submenu');
|
||||||
|
@ -19,6 +17,7 @@
|
||||||
setActive($this);
|
setActive($this);
|
||||||
$('iframe').attr('src', $this.attr('href'));
|
$('iframe').attr('src', $this.attr('href'));
|
||||||
});
|
});
|
||||||
|
$breadNav.hide();
|
||||||
$subMenu.find('a').each(function (index, ele) {
|
$subMenu.find('a').each(function (index, ele) {
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
if ($this.attr('href') == window.location.pathname) setActive($this);
|
if ($this.attr('href') == window.location.pathname) setActive($this);
|
||||||
|
|
Loading…
Reference in New Issue