javascript - 滚动条显示在其他内容上
问题描述
我正在处理选项卡菜单,所以我有 2 个内容显示带有滚动条的表格。我的问题是当我切换到其他内容时,其他内容的滚动保留。
希望你能帮助我谢谢。
$('tbody').niceScroll({autohidemode: false});
$('.table:first-child').show();
$('.side ul li').click(function(){
$(this).addClass('active').siblings().removeClass('active');
var index = $(this).index() + 1;
$('.container .table:nth-child('+ index +')').show().siblings().hide();
});
解决方案
在 nicescroll 对象上触发 aresize
似乎有效:
$('tbody').niceScroll({autohidemode: false});
$('.table:first-child').show();
$('.side ul li').click(function(){
$(this).addClass('active').siblings().removeClass('active');
var index = $(this).index() + 1;
$('.container .table:nth-child('+ index +')').show().siblings().hide();
$('tbody').getNiceScroll().resize();
});
推荐阅读
- apostrophe-cms - 更改值的公共用户功能
- java - 可以重新安排被阻塞的线程来做其他工作吗?
- flutter - 没有用户身份验证的 Firestore 安全规则
- javascript - Angular Scroll-Into-View - 但仅适用于视图外的项目(需要滚动到)
- asp.net-web-api - 从控制器返回 ADO.Net 查询作为 JSON 数组
- php - 数字集合评分系统(序列号)
- javascript - 无法让 DOT NET CORE MVC 将多个 LINQ 结果返回到视图
- c - 创建一个根据输入的整数显示 N 或 P 的函数
- java - 如何在 IntelIJ 中禁用子文件夹分组?
- php - adMethodCallException:在 Jenssegers\Mongodb\Eloquent\Model 上调用未定义的方法 App\Candidate::name()