nicescroll.js - 如何禁用垂直滚动条?

nicescroll.js - how to disable vertical scrollbar?

我用jquery-nicescroll:

$(this.refs.container).niceScroll({
  cursorcolor: '#f16221',
  cursorwidth: '14',
  cursorminheight: '64',
  scrollspeed: '50',
  autohidemode: 'false',
  overflowy: 'false'
})

目前它有两个滚动条:垂直和水平。我需要 hide/disable 垂直滚动条,但还没有找到解决方案。我试过添加 overflowy: 'false' 但没有成功。 horizrailenabled: false 效果很好,但没有垂直选项。

类似问题: Disable Vertical Scroll in niceScroll Js

如何使用nicescroll隐藏垂直滚动条?

我建议添加以下 jQuery 代码以获得完整的解决方案,以禁用和隐藏垂直滚动条:

var nice = 
    $(this.refs.container).niceScroll({
        cursorcolor: '#f16221',
        cursorwidth: '14',
        cursorminheight: '64', 
        scrollspeed: '50',
        autohidemode: 'false',
        overflowy: 'false'
    });

var _super = nice.getContentSize;

nice.getContentSize = function () {
    var page = _super.call(nice);
    page.h = nice.win.height();
    return page;
}

$('.nicescroll-rails.nicescroll-rails-vr').remove();

(在 https://code.google.com/archive/p/jquery-nicescroll/issues/27 中部分提及)