【问题标题】:Chrome Issue : overflow-x element scrolled by draggingChrome 问题:overflow-x 元素通过拖动滚动
【发布时间】:2013-07-08 17:01:51
【问题描述】:

如题,下面是win7/Chrome27/IE9/FF22中的测试。

风格:

.outer{
    width : 400px;
    height: 400px;
    overflow: hidden;
    overflow-x : hidden;
    overflow-y : auto;
}

.inner{
    border-left:400px solid red;
    border-right: 400px solid green;
    height: 600px;
    text-align: center;
    line-height: 400px;
}
</style>

html:

    <div class="outer">
        <div class="inner">
        </div>
    </div>

在 IE/FF 中只能看到左边的红色部分。

但在 Chrome 中,内部元素可能会拖到右侧。这是 chrome 的问题吗?又如何避免呢?

正常(即/ff):

非正常(铬):

jsfiddle:http://jsfiddle.net/LULDC/

【问题讨论】:

  • 您使用的是哪个版本的 Chrome?
  • @AndréDion 27.0.1453.116 m
  • 您的小提琴在 Mac OS X (10.7) 中运行的 Chrome 27.0.1453.116 中没有为我重现错误
  • @AndréDion 它发生在 win7 中
  • Chrome 29.0.1547.0, win7, 显示全红。有没有可能是一个插件改变了风格?或者它可能会在 Chrome 版本之间得到修复。

标签: css google-chrome overflow


【解决方案1】:

添加溢出:y;到你的 .inner 类

.inner{
    border-left:400px solid red;
    border-right: 400px solid green;
    height: 600px;
    text-align: center;
    line-height: 400px;
    overflow:y;
}

http://jsfiddle.net/LULDC/

不再需要通过点击和拖动来滚动!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-01-26
    • 2021-09-19
    • 2021-01-02
    • 1970-01-01
    • 1970-01-01
    • 2020-01-05
    • 1970-01-01
    相关资源
    最近更新 更多