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:
16
media/js/init-scroll-bar.js
Normal file
16
media/js/init-scroll-bar.js
Normal 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 }');
|
||||
}
|
Reference in New Issue
Block a user