鼠标滚轮不起作用,select2和jQuery自定义内容滚动条

时间:2016-08-12 09:21:48

标签: javascript jquery scroll scrollbar jquery-select2

我结合了select2和jQuery自定义内容滚动库来获得一个很好的功能性下拉列表但由于某些原因我不能使它在鼠标滚轮上工作。

这里有一个用于加载组件的简单代码,我尝试了不同的方法以及内置选项但到目前为止没有运气

$('#testDropdown').select2();

$("span.select2-selection").on("click", function () {
    $(".select2-results").toggleClass("mCustomScrollbar").attr('data-mcs-theme', 'gray-theme');
    $(".select2-results").mCustomScrollbar("destroy");
    $(".select2-results").mCustomScrollbar({
      advanced: {
        updateOnContentResize: true
      }, 
      live: true,
      mouseWheel:true,    
      scrollInertia: 500
    });
});

FIDDLE

任何指针都会受到赞赏

0 个答案:

没有答案