-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
鼠标进入信息卡片时,动态窗口被关闭 #96
Comments
是的,从功能上说是这样没错。但是实现上可能比较有难度,因为动态那个弹出框的判断是B站的逻辑,然后你进入信息卡片的时候可能就判断出那个框了。 |
解决方案只完成了阻止弹出框收回,在弹出框外触发弹出框的 let stopPropagation = ev => {ev.stopPropagation();}; // 阻止事件传播的函数
let dynamicPopup = document.querySelectorAll(".right-entry .v-popover-wrap")[3] // 找到动态弹出框的位置
dynamicPopup.addEventListener("mouseleave", stopPropagation, true) // 增加阻止弹出框触发 "mouseleave" 的事件
dynamicPopup.removeEventListener("mouseleave", stopPropagation, true) // 恢复弹出框的 "mouseleave" 事件 待解决的问题如果离开 待讨论的想法我觉得可以在找到的 |
如果可以直接删除 查了一下,chrome extension提供了chrome.debugger 和 DOMDebugger.getEventListeners, 可以获取到DOM的 另一种获取 |
在 b 站页面加载之前, 目标 DOM 元素都不存在,怎么缓存 感觉最好的方式还是我写的这三行代码,可以实现动态阻止事件运行。 let stopPropagation = ev => {ev.stopPropagation();}; // 阻止事件传播的函数
let dynamicPopup = document.querySelectorAll(".right-entry .v-popover-wrap")[3] // 找到动态弹出框的位置
dynamicPopup.addEventListener("mouseleave", stopPropagation, true) // 增加阻止弹出框触发 "mouseleave" 的事件 |
2023-12-24.10.56.53-1.mov
从用户体验上说,鼠标进入信息卡片时保持动态窗口打开可能更合理
The text was updated successfully, but these errors were encountered: