refactor: 移除二级菜单展开后自动滚动特效
comment 中间的二级菜单自带次特效 最后一个菜单无此特效
This commit is contained in:
parent
f839255d82
commit
6d30cd02d5
|
@ -16,7 +16,7 @@
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
addNiceScroll: function () {
|
addNiceScroll: function () {
|
||||||
if (!$.browser.versions.ios && $(window).width() > 768) {
|
if ($(window).width() > 768) {
|
||||||
this.overlayScrollbars({
|
this.overlayScrollbars({
|
||||||
className: 'os-theme-light',
|
className: 'os-theme-light',
|
||||||
scrollbars: {
|
scrollbars: {
|
||||||
|
@ -175,25 +175,10 @@ $(function () {
|
||||||
$breadNav.removeClass('d-none').text(arch.text() || $('title').text());
|
$breadNav.removeClass('d-none').text(arch.text() || $('title').text());
|
||||||
|
|
||||||
// custom scrollbar
|
// custom scrollbar
|
||||||
var $sidebar = $('.sidebar').addNiceScroll().autoScrollSidebar({ target: arch.parent(), offsetTop: arch.parent().innerHeight() / 2 });
|
$sidebar = $('.sidebar').addNiceScroll().autoScrollSidebar({ target: arch.parent(), offsetTop: arch.parent().innerHeight() / 2 });
|
||||||
|
|
||||||
$sideMenu.on('click', 'a.dcjq-parent', function () {
|
// 大于 768 时考虑网站设置 收缩侧边栏
|
||||||
return;
|
if ($(window).width() > 768) {
|
||||||
var $this = $(this);
|
|
||||||
if (!$.browser.versions.ios && $(window).width() > 768) {
|
|
||||||
setTimeout(function () {
|
|
||||||
var offsetScroll = parseInt($this.parents('.mCSB_container').css('top').replace('px', ''));
|
|
||||||
$sidebar.autoScrollSidebar({ target: $this.parent(), offsetTop: 25.5 - offsetScroll });
|
|
||||||
}, 600);
|
|
||||||
}
|
|
||||||
else if ($.browser.versions.ios && $(window).width() > 768) {
|
|
||||||
var offsetScroll = parseInt($this.parents('aside').scrollTop());
|
|
||||||
$sidebar.autoScrollSidebar({ target: $this.parent(), offsetTop: 25.5 + offsetScroll });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 大于 769 时考虑网站设置 收缩侧边栏
|
|
||||||
if ($(window).width() > 769) {
|
|
||||||
var $ele = $('aside');
|
var $ele = $('aside');
|
||||||
var collapsed = $ele.hasClass('collapsed');
|
var collapsed = $ele.hasClass('collapsed');
|
||||||
if (collapsed) {
|
if (collapsed) {
|
||||||
|
|
Loading…
Reference in New Issue