javascript - 如何在 iOS Chrome 中使用 CSS scroll snap + picture bug 隐藏滚动条

标签 javascript html ios css safari

如何在 iOS Safari 和 Chrome 中隐藏 native 滚动条?我正在使用这段代码:

.scroll-snap-container::-webkit-scrollbar {
    display: none!important;
    height: 0;
    width: 0;
    background-color: transparent;
}

这不适用于 iOS Safari 和 Chrome。

Arrow showing native scrollbar when scrolling

最佳答案

尝试将其添加到您的代码中。

@media screen and (-webkit-min-device-pixel-ratio:0) { 
.scroll-snap-container::-webkit-scrollbar {
display: none!important;
height: 0;
width: 0;
background-color: transparent;
 }
}

关于javascript - 如何在 iOS Chrome 中使用 CSS scroll snap + picture bug 隐藏滚动条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56792969/

相关文章:

javascript - 如何在 THREE.js 中生成粒子系统

javascript - 使用 Node.js v5.10.1 时出现 'inherits' 错误

javascript - 如何合并两个具有相同图例项目的 Highcharts 容器

javascript - Firefox Addon Builder 首选项 - 服务对我不起作用 - 为什么?

ios - 线程 1 :signal sigabrt error constraints withVisualFormat

ios - Xcode 导出本地化抛出错误 "Argument list too long"

ios - 如何在 iPhone 上创建多个窗口/ View ?

javascript - 将脚本应用于项目中的所有页面

html - :after not working 上的 CSS 变换旋转

css - 如何使用 HTML5 或 CSS 代码将小工具、小工具标题和链接列表置于 blogger 的页 footer 分?