refactor: 移除二级菜单展开后自动滚动特效

comment 中间的二级菜单自带次特效 最后一个菜单无此特效
This commit is contained in:
Argo Zhang 2019-08-19 09:49:12 +08:00
parent f839255d82
commit 6d30cd02d5
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
1 changed files with 4 additions and 19 deletions

View File

@ -16,7 +16,7 @@
return this;
},
addNiceScroll: function () {
if (!$.browser.versions.ios && $(window).width() > 768) {
if ($(window).width() > 768) {
this.overlayScrollbars({
className: 'os-theme-light',
scrollbars: {
@ -175,25 +175,10 @@ $(function () {
$breadNav.removeClass('d-none').text(arch.text() || $('title').text());
// 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 () {
return;
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) {
// 大于 768 时考虑网站设置 收缩侧边栏
if ($(window).width() > 768) {
var $ele = $('aside');
var collapsed = $ele.hasClass('collapsed');
if (collapsed) {