通过溢出防止父级中超大子级的滚动:隐藏(webkit)
我的 Webkit 浏览器有问题。当我将光标聚焦到 元素并开始移动鼠标而不释放按钮时,就会出现此问题。
这是一个截屏视频 - http://screencast.com/t/P1BnT7ZAdc
这是一个 html/css 演示 - http://napokrovke.mysundays.net/webkit_bug.html
我怎样才能防止这种情况 行为?
I have an issues with Webkit browsers. The issue happens when I focus my cursor to the <input>
element and start to move mouse without releasing the button.
Here is a screencast - http://screencast.com/t/P1BnT7ZAdc
Here is a html/css demo - http://napokrovke.mysundays.net/webkit_bug.html
How can I prevent this behavior?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这不是一个错误,它是因为您将包装器设置为 300px,并对其应用了隐藏的溢出属性,这允许您在内容大于您定义的 300px 时滚动,我在 OSX 上的 firefox 中我还可以在其中滚动。
强制执行此操作的唯一方法可能是将其应用于文本字段 html 标记,
这应该禁止用户在框内选择时拖动,但它也会禁止您在框内单击,因此使用焦点时您必须聚焦手动此框。但如果那是你真正想要的?
This is not a bug, its because you've set the wrapper to 300px, and applied the overflow property of hidden to it, which allows you to scroll around if the content within is greater than the 300px you defined, Im in firefox on OSX and I can also scroll around in it.
the only way this can be forced is maybe to apply this to the text field html markup
this should disable the user from dragging around when selected inside the box, but then it also disables you clicking inside the box, so using focus you have to focus this box manually. but if thats what you really want?