Z 索引元素中的 Internet Explorer 滚动错误
我创建了一个弹出菜单,在导航区域中显示链接列表。下面是包含 div 的相关 css:
overflow: hidden;
position: absolute;
display: none;
z-index: 200;
div 附加了 javascript,这样如果导航菜单延伸到屏幕底部下方,它会添加溢出 y 滚动并调整其大小以适应。偶然地,这些导航菜单是在另一个滚动元素附近生成的,并在其上延伸。
如果您使用鼠标滚轮滚动,则效果非常好。但是,如果您单击并拖动滚动条,则在释放滚动条并与导航菜单或下面的元素交互之前,延伸到其他滚动元素的菜单部分不会更新。
如何强制元素更新?该页面具有过渡/宽松的文档类型。上述缺陷存在于 Internet Explorer 中,但 Chrome 中不存在。
I have created a popover menu that displays a list of links in a navigation area. Here is the relevant css for the containing div:
overflow: hidden;
position: absolute;
display: none;
z-index: 200;
There is javascript attached to the div such that if the navigation menu extends below the bottom of the screen, it adds overflow-y scrolling and resizes it to fit. By chance, these navigation menus are generated adjacent to another scrolling element and extend over it.
This works perfectly if you use the mouse wheel to scroll. However, if you click and drag the scrollbar, the part of the menu that extends over the other scrolling element is not updated until you release the scrollbar and interact with either the nav menu or the element underneath.
How do you force the element to update? The page has a transitional/loose doctype. The above defect is present in internet explorer, but not chrome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能够通过这样做(使用 jQuery)解决这个问题:
I was able to resolve the issue by doing this (with jQuery):