FIX Firefox 标签滚动事件&滚动顺序

This commit is contained in:
sc 2021-07-13 16:06:45 +08:00
parent 6694010b06
commit b187e17bee
1 changed files with 3 additions and 2 deletions

View File

@ -197,13 +197,14 @@
// //
scrollInit(){ scrollInit(){
const scrollDiv = this.$refs.tags; const scrollDiv = this.$refs.tags;
scrollDiv.addEventListener('mousewheel', handler, false) scrollDiv.addEventListener('mousewheel', handler, false) || scrollDiv.addEventListener("DOMMouseScroll", handler, false)
function handler(event) { function handler(event) {
const detail = event.wheelDelta || event.detail; const detail = event.wheelDelta || event.detail;
//-3 3120 -120
const moveForwardStep = 1; const moveForwardStep = 1;
const moveBackStep = -1; const moveBackStep = -1;
let step = 0; let step = 0;
if (detail < 0) { if (detail == 3 || detail < 0 && detail != -3) {
step = moveForwardStep * 50; step = moveForwardStep * 50;
}else{ }else{
step = moveBackStep * 50; step = moveBackStep * 50;