Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我的网站,我的弹出气泡有问题。这些实际上是 jquery 对话框。当您向下滚动页面到视频时,它们会在弹出时强制您向上滚动。如何关闭这些对话框的自动对焦功能?
不确定您在网站上的活跃程度,但问题是因为您用来打开对话框的链接有一个哈希标记作为 href:
<a href="#">open dialog</a>
锚点中的这个散列表示一个散列链接。如果没有 id,它会使用 window 对象并滚动回页面顶部。
为了防止,使用:
<a href="javascript: void(0);">open dialog</a>