修改BUG:iPhoneX横屏模式下侧边栏无法滚动

This commit is contained in:
Argo-MacBookPro 2018-09-23 14:48:46 +08:00
parent e53d603211
commit abdf2a5977
1 changed files with 11 additions and 7 deletions

View File

@ -166,7 +166,10 @@ $(function () {
return this;
},
addNiceScroll: function () {
if (!$.browser.versions.ios && $(window).width() > 768) {
if ($.browser.versions.ios && $(window).width() > 768) {
this.css('overflow', 'auto');
}
else if (!$.browser.versions.ios && $(window).width() > 768) {
this.mCustomScrollbar({ theme: 'minimal' });
}
else {
@ -180,12 +183,13 @@ $(function () {
var $sidebar = $('aside').addNiceScroll().autoScrollSidebar({ target: arch.parent(), offsetTop: arch.parent().innerHeight() / 2 });
$sideMenu.on('click', 'a.dcjq-parent', function () {
if ($(window).width() <= 768) return;
var $this = $(this);
setTimeout(function () {
var offsetScroll = parseInt($this.parents('.mCSB_container').css('top').replace('px', ''));
$sidebar.autoScrollSidebar({ target: $this.parent(), offsetTop: 25.5 - offsetScroll });
}, 600);
if (!$.browser.versions.ios && $(window).width() > 768) {
var $this = $(this);
setTimeout(function () {
var offsetScroll = parseInt($this.parents('.mCSB_container').css('top').replace('px', ''));
$sidebar.autoScrollSidebar({ target: $this.parent(), offsetTop: 25.5 - offsetScroll });
}, 600);
}
});
$('.sidebar-toggle-box').on('click', function () {