当前位置:网站首页>Read the wheelevent in one article
Read the wheelevent in one article
2022-07-27 15:36:00 【polite】
https://segmentfault.com/a/1190000017390159?utm_source=tag-newest
<template>
<el-scrollbar
ref="scrollContainer"
:vertical="false"
class="scroll-container"
@wheel.native.prevent="handleScroll"
>
<slot/>
</el-scrollbar>
</template>
<script>
export default {
name: "ScrollPane",
data() {
return {
left: 0
};
},
methods: {
handleScroll(e) {
// wheelDelta: Get the scroll wheel rolling direction , Up 120, Down -120, But constant , Independent of roller speed
// deltaY: Vertical scrolling range , Positive values scroll down . The default value for the number of vertical lines of the computer mouse wheel is 3
// wheelDelta Only some browsers support ,deltaY Almost all browsers support
const eventDelta = e.wheelDelta || -e.deltaY * 40;
const $scrollWrapper = this.$refs.scrollContainer.$refs.wrap;
// 0 To scrollLeft Hide part for scrolling area
$scrollWrapper.scrollLeft = $scrollWrapper.scrollLeft + eventDelta / 4;
}
}
};
</script>
边栏推荐
- HJ8 合并表记录
- 学习Parquet文件格式
- "Sword finger offer" linked list inversion
- Network equipment hard core technology insider router Chapter 18 dpdk and its prequel (III)
- Dan bin Investment Summit: on the importance of asset management!
- npm install错误 unable to access
- Cap theory and base theory
- Unity's simplest object pool implementation
- 魔塔项目中的问题解决
- Network equipment hard core technology insider router Chapter 3 Jia Baoyu sleepwalking in Taixu Fantasy (middle)
猜你喜欢

Unity性能优化------渲染优化(GPU)之LOD(Level of detail)

EMC design scheme of USB2.0 Interface

Leetcode 781. rabbit hash table in forest / mathematical problem medium

EMC design scheme of CAN bus

reflex

谷粒商城配置CorsWebFilter后,报错:Resource sharing error:MultipleAllowOriginValues

Spark 本地程序启动缓慢问题排查

Unity performance optimization ----- occlusion culling of rendering optimization (GPU)

Spark Bucket Table Join

Spark 3.0 DPP实现逻辑
随机推荐
Leetcode 244 week competition - post competition supplementary question solution [broccoli players]
Network equipment hard core technology insider router Chapter 10 Cisco asr9900 disassembly (III)
Selenium 报错:session not created: This version of ChromeDriver only supports Chrome version 81
Sword finger offer cut rope
Leetcode 244周赛-赛后补题题解【西兰花选手】
Network equipment hard core technology insider router Chapter 21 reconfigurable router
Leetcode 341. flattened nested list iterator DFS, stack / medium
Leetcode 781. rabbit hash table in forest / mathematical problem medium
Photoelectric isolation circuit design scheme (six photoelectric isolation circuit diagrams based on optocoupler and ad210an)
Four kinds of relay schemes driven by single chip microcomputer
QT (XIII) qchart drawing line chart
西瓜书《机器学习》阅读笔记之第一章绪论
/dev/loop1占用100%问题
谷粒商城配置CorsWebFilter后,报错:Resource sharing error:MultipleAllowOriginValues
USB interface electromagnetic compatibility (EMC) solution
Unity3d learning note 10 - texture array
Network equipment hard core technology insider router Chapter 3 Jia Baoyu sleepwalking in Taixu Fantasy (middle)
Network equipment hard core technology insider router Chapter 14 from deer by device to router (middle)
Record record record
《吐血整理》C#一些常用的帮助类