Hi FE !
Ai
git
前端面试题
前端小tip
  • vite
  • webpack
npm
  • vue2
  • vue3
react
GitHub
Ai
git
前端面试题
前端小tip
  • vite
  • webpack
npm
  • vue2
  • vue3
react
GitHub
  • windows 设置 mac 滚动条效果

windows 设置 mac 滚动条效果

body {
  margin: 0;
  overflow: overplay;
  background-color: transparent;
  transition: 0.3s background-color;
}
::-webkit-scrollbar {
  background-color: transparent;
  width: 12px;
}
::-webkit-scrollbar-thumb {
  background-color: inherit;
  border-radius: 8px;
  background-clip: content-box;
  border: 2px solid transparent;
}
body[scroll],
::-webkit-scrollbar-thumb:hover {
  transition: 0s;
  background-color: rgba;
}
window.addEventListener("scroll", function () {
  this.document.body.toggleAttribute("scroll", true);
  this.timer && this.clearTimeout(this.timer);
  this.timer = setTimeout(() => {
    document.body.toggleAttribute("scroll");
  }, 500);
});
Edit this page
最近更新: 2025/12/2 01:46
Contributors: qdleader
qdleader
本站总访问量 129823次 | 本站访客数 12人