0

使用 PerfectScrollbar 0.6.11,我不能让鼠标滚轮在模式中滚动元素。

这是一个小提琴:https ://jsfiddle.net/9e64aspu/

$('#modal-filters').on('shown.bs.modal', function () {
      $('#filters-scroll').perfectScrollbar({
            suppressScrollY : true,
            handlers: ['click-rail', 'drag-scrollbar', 'wheel', 'touch'],
            wheelPropagation: true
     });
});

滚动条显示,但我不能使用滚轮滚动。正常吗?

4

1 回答 1

0

您需要添加此选项useBothWheelAxes: true

你的 js 代码应该是这样的

$(function() {
    $('#modal-filters').on('shown.bs.modal', function() {
        $('#filters-scroll').perfectScrollbar({
            suppressScrollY: true,
            theme: 'dark',
            handlers: ['click-rail', 'drag-scrollbar', 'wheel', 'touch'],
            wheelPropagation: true,
            useBothWheelAxes: true,
        });
    });
});

更新小提琴https://jsfiddle.net/5wkbszd3/3/

于 2019-08-14T23:24:21.273 回答