【发布时间】:2016-09-02 15:34:53
【问题描述】:
使用overflow:auto 将表格包裹在一个狭窄的 div 下。在chrome、IE、FF下,宽度超过200是预期的。但在 Safari 中,with 是 100。
Jquery width() 文档没有提到这一点? https://api.jquery.com/width/
代码笔,打开控制台并滚动查看日志: http://codepen.io/anon/pen/adZxrd
万一失败,详情如下。
HTML:
<div class="outer">
<table class="table table-hover table-condensed">
<thead>
<tr>
<td>aaaaaaaaa</td>
<td>bbbbbbbbbbbbbb</td>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
CSS:
.outer {
width:100px;
overflow:auto;
}
.inner {
width:200px;
border:1px solid black;
}
JS:
$('.outer').scroll(function(){
console.log($('.table').width())
});
【问题讨论】:
-
你找到解决办法了吗?
标签: javascript jquery css safari width