优化 table 鼠标在固定列滚轮时无法触发滚动条的问题

pull/1417/head
贤心 2023-10-31 22:11:31 +08:00
parent 2e27604e15
commit 226e2ea060
1 changed files with 9 additions and 0 deletions

View File

@ -2604,6 +2604,15 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
layer.close(that.tipsIndex);
});
// 固定列滚轮事件 - 临时兼容方案
that.layFixed.find(ELEM_BODY).on('mousewheel DOMMouseScroll', function(e) {
var delta = e.originalEvent.wheelDelta || -e.originalEvent.detail;
var scrollTop = that.layMain.scrollTop();
var step = 30;
that.layMain.scrollTop(scrollTop + (delta > 0 ? -step : step));
});
};
// 全局事件