1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-12 13:24:52 +00:00

optimize win scrollbar style

This commit is contained in:
杨顺强
2023-07-06 10:34:34 +08:00
parent 78fb9c46ad
commit 6ede11ec32
2 changed files with 17 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
var agent = navigator && navigator.userAgent;
var lowCaseAgent = agent && agent.toLocaleLowerCase()
var isWin = lowCaseAgent && (
(lowCaseAgent.indexOf('win32') > -1 || lowCaseAgent.indexOf('wow32') > -1) ||
(lowCaseAgent.indexOf('win64') > -1 || lowCaseAgent.indexOf('wow64') > -1)
)
if (isWin) {
var style = document.createElement('style');
document.head.appendChild(style);
var sheet = style.sheet;
sheet.insertRule('div::-webkit-scrollbar { width: 8px;height: 8px; }');
sheet.insertRule('div::-webkit-scrollbar-button { display: none; }');
sheet.insertRule('div::-webkit-scrollbar-thumb { background-color: rgb(206, 206, 212);border-radius: 10px; }');
sheet.insertRule('div.vertical-scrollbar::-webkit-scrollbar-thumb { min-height: 40px }');
}