css - 在 OS X 中使用 USB 鼠标与无线/触控板时滚动条的外观不同

标签 css macos scrollbar

我刚刚意识到无论是否连接 USB 鼠标,Mac OS X 都会在浏览器中显示不同的滚动条。我尝试了下面的代码,它看起来不错,但是现在当我断开鼠标的连接时,它也适用于无线设置,我已经对此感到满意(滚动条仅在滚动或悬停时显示)。

::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 15px;
    background-clip: padding-box;
    border: 4px solid rgba(0, 0, 0, 0);
    -webkit-border-radius: 7px;
    background-color: rgba(0, 0, 0, 0.15);
    -webkit-box-shadow: inset -1px -1px 0px rgba(0, 0, 0, 0.05), inset 1px 1px 0px rgba(0, 0, 0, 0.05);
}
::-webkit-scrollbar-thumb {
    border: 4px solid rgba(0, 0, 0, 0);
    background-clip: padding-box;
    -webkit-border-radius: 7px;
    background-color: rgba(255, 255, 255, 0.8);
    -webkit-box-shadow: inset -1px -1px 0px rgba(0, 0, 0, 0.05), inset 1px 1px 0px rgba(0, 0, 0, 0.05);
}

我可以吗:
1.只为USB鼠标写CSS?
2. 做一些让 USB 鼠标看起来/行为像无线鼠标的事情。

谢谢!

最佳答案

这是我发现的:
OSX: Remove scrollbars that appear when using a mouse

Fortunately the solution lay in the General preferences pane. All that's needed is to change "Show scroll bars" to "When scrolling" instead of "Automatically based on mouse or trackpad.



enter image description here

结论 :我认为解决方案超出了我们/开发人员的控制范围。把它留给用户。

关于css - 在 OS X 中使用 USB 鼠标与无线/触控板时滚动条的外观不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44668257/

相关文章:

html - 多级菜单激活激活

android - 苹果机 : AVD wont launch

xcode - 如何在 Mac OS 中创建模态滑出窗口?

ios - objective-c 中大于38位数字的乘法或除法

jquery - 尝试使用 jQuery 制作自定义滚动

html - 根据条件动态填充 div

css - 内容在正圆内的 Div

javascript - JQuery 插件优化

html - 如何让滚动条覆盖内容

html - 向 HTML 表格添加水平滚动条