fix: 目录弹窗滚动事件阻止冒泡,防止触发内容区域滚动
This commit is contained in:
parent
76f39363a0
commit
bad2cb6c7a
@ -622,6 +622,25 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 阻止目录弹窗的滚动事件冒泡到页面
|
||||||
|
const tocList = document.getElementById('tocList');
|
||||||
|
tocList.addEventListener('wheel', (e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
}, { passive: true });
|
||||||
|
|
||||||
|
tocList.addEventListener('touchmove', (e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
}, { passive: true });
|
||||||
|
|
||||||
|
// 阻止弹窗内容区域的滚动冒泡
|
||||||
|
document.querySelector('.toc-content').addEventListener('wheel', (e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
}, { passive: true });
|
||||||
|
|
||||||
|
document.querySelector('.toc-content').addEventListener('touchmove', (e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
}, { passive: true });
|
||||||
|
|
||||||
// 初始化 - 等待app.js加载章节数据
|
// 初始化 - 等待app.js加载章节数据
|
||||||
document.addEventListener('DOMContentLoaded', async function() {
|
document.addEventListener('DOMContentLoaded', async function() {
|
||||||
// 等待章节数据加载完成
|
// 等待章节数据加载完成
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user