jQuery 自定义滚动导致闪烁
jQuery custom scroll causes flicker
我正在使用这个 jQuery custom content scroller,它会导致可滚动部分闪烁。
- 单击另一个随机按钮时它会持续闪烁
- 如果我不采取任何行动,它会每隔几秒闪烁一次
使用的代码:
$('.custom-scrollbar').mCustomScrollbar({
scrollInertia: 0,
alwaysShowScrollbar: 1, // adding / removing this causes no difference
scrollbarPosition: 'outside'
});
附上 gif 演示问题:http://gyazo.com/9ea9d558f2630c74a157c70a367d1868
如果对任何人有帮助:作为修复,我刚刚为容器添加了 1px 的填充;不再闪烁。
此自定义滚动条在其容器有填充时会闪烁。在 css 中从此容器中删除所有填充。前狐狸
.mCSB_container.mCS_no_scrollbar_y.mCS_y_hidden
{
padding: 0px;
}
我找不到在我的特定情况下有效的 CSS 解决方案,但禁用 updateOnContentResize
advanced setting 可以解决问题(当然,以禁用相应功能为代价):
$(".content").mCustomScrollbar({
advanced: {
updateOnContentResize: false
}
});
我正在使用这个 jQuery custom content scroller,它会导致可滚动部分闪烁。
- 单击另一个随机按钮时它会持续闪烁
- 如果我不采取任何行动,它会每隔几秒闪烁一次
使用的代码:
$('.custom-scrollbar').mCustomScrollbar({
scrollInertia: 0,
alwaysShowScrollbar: 1, // adding / removing this causes no difference
scrollbarPosition: 'outside'
});
附上 gif 演示问题:http://gyazo.com/9ea9d558f2630c74a157c70a367d1868
如果对任何人有帮助:作为修复,我刚刚为容器添加了 1px 的填充;不再闪烁。
此自定义滚动条在其容器有填充时会闪烁。在 css 中从此容器中删除所有填充。前狐狸
.mCSB_container.mCS_no_scrollbar_y.mCS_y_hidden
{
padding: 0px;
}
我找不到在我的特定情况下有效的 CSS 解决方案,但禁用 updateOnContentResize
advanced setting 可以解决问题(当然,以禁用相应功能为代价):
$(".content").mCustomScrollbar({
advanced: {
updateOnContentResize: false
}
});