Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/409.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在rtl和ltr方向上,Chrome scrollWidth不同_Javascript_Css_Google Chrome_User Interface - Fatal编程技术网

Javascript 在rtl和ltr方向上,Chrome scrollWidth不同

Javascript 在rtl和ltr方向上,Chrome scrollWidth不同,javascript,css,google-chrome,user-interface,Javascript,Css,Google Chrome,User Interface,我在谷歌浏览器上看到一个bug。 在Chrome V 31上运行以下html代码 <!DOCTYPE html> <html> <head> <title>Chrome scrollWidth issue</title> <meta charset="utf-8"> </head> <body style="direction: ltr;"> <div style="overflow

我在谷歌浏览器上看到一个bug。 在Chrome V 31上运行以下html代码

<!DOCTYPE html>
<html>
<head>
  <title>Chrome scrollWidth issue</title>
  <meta charset="utf-8">
</head>
<body style="direction: ltr;">
  <div style="overflow: auto; height: 100px; width: 800px; border: 1px solid red;">
    <div style="height: 150px; width: 1080px; background: blue;"></div>
  </div>
</body>
</html>

Chrome滚动宽度问题
当我将主体方向从
ltr
更改为
rtl
时,父div的
scrollWith
是不同的。 这不会发生在FireFox V25或Internet Explorer V10上

我就这个问题作了报告


我的问题是如何用css或javascript解决这个问题?

将它添加到父
div
的css上

float:left

尝试在子元素中使用clientWidth,您将在rtl和ltr中获得1080,希望这是一个足够好的解决方案,直到他们修复chrome上的错误。

我重复了错误。有趣的。。。我以前不在家长组。我很好奇。。。他们看起来和反应都一样。。这给你带来了什么问题?@Phlume我们在团队中使用Sencha ExtJs,我看到了在rtl模式下调整网格组件大小的问题,然后我发现这是在计算列数,最后我在google chrome v 31上发现了这个错误@Omidsharati我也在使用Chrome V 31我不明白你的问题。我的机器运转良好。