javascript - CSS使用不透明度,然后滚动表格,tbody的td覆盖了tad的th,为什么?
问题描述
我使用这个 css 将表设置为禁用。
.disabledDiv {
pointer-events: none;
opacity: 0.9;
}
我必须使用这种透明度。
当我滚动滚动条时,tbody 的 td 覆盖了 thead 的 th,就像这样:
我不希望 th 被覆盖,这是我在 jsfiddle 中的代码链接。
如何让th不被覆盖?
解决方案
正如@Gerard 提到的,您有用于移动广告部分的滚动事件的 eventListener。解决方案 - 只需删除 thead 部分的 js 部分。
document.getElementById("table_reach_condition_appoint").addEventListener("scroll", function(){
var translate = "translate(0,"+this.scrollTop+"px)";
this.querySelector("thead").style.transform = translate;
});
推荐阅读
- angular - 样式移动到文件夹?
- c++ - 使用带有新信号槽语法的 Qt 插件系统在接口类中声明信号
- python - 使用 Python 获取 Google OAuth 凭据
- google-sheets - Google 电子表格自动填充基于列的行
- angular - 通知另一个组件在特定组件中单击了按钮
- ruby - 验证用户是否登录的方法不适用于 Sinatra 应用程序。
- java - 如何通过 url 链接“递归”读取所有文件和文件夹
- python - 通过从其他 DataFrame 中选择值填充 Pandas DataFrame 中的 NaN
- blockchain - 在基于以太坊的区块链数据库上查询有多快?
- javascript - Material-UI:提供给 createMuiTheme 的阴影数组应该支持 25 个高度