- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我从这个开始:
*::-webkit-scrollbar {
}
*::-webkit-scrollbar-button {
}
*::-webkit-scrollbar-track {
}
*::-webkit-scrollbar-track-piece {
}
*::-webkit-scrollbar-thumb:active {
width: 6px;
background-color: red;
}
*::-webkit-scrollbar-corner {
}
*::-webkit-resizer {
}
如何重新创建滚动条的动画/淡入淡出功能仅当您开始滚动,然后当您将鼠标悬停在滚动条上时,它会变宽。现在,如果我尝试使用这些方法设计它的样式,它就会永久存在。我需要自定义 JavaScript 来执行此操作还是有其他方法?
我只想更改所有滚动条的背景图像,但它仍然像所有现有的 mac 滚动条一样工作。
最佳答案
我没有适合您的纯 CSS 解决方案,我倾向于使用 a custom scrollbar library 在 JS 中执行此操作(不隶属于我)。
添加库后,您可以简单地使用以下 jQuery 对其进行初始化:
$('.container').mCustomScrollbar({
theme: "dark-3", // some theme examples: http://manos.malihu.gr/repository/custom-scrollbar/demo/examples/scrollbar_themes_demo.html
autoExpandScrollbar: true, //options list can be found here http://manos.malihu.gr/jquery-custom-content-scroller/#configuration-section
autoHideScrollbar: true
});
下面是一个工作示例:
$('.container').mCustomScrollbar({
theme: "dark-3",
autoExpandScrollbar: true,
autoHideScrollbar: true
});
.container {
width: 200px;
height: 100px;
overflow: hidden;
background-color: #fafafa;
padding: 10px;
border: 1px solid black;
}
.container p {
margin: 5px 0;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.css" rel="stylesheet" />
<div class="container">
<p>This is a test 1</p>
<p>This is a test 2</p>
<p>This is a test 3</p>
<p>This is a test 4</p>
<p>This is a test 5</p>
<p>This is a test 6</p>
<p>This is a test 7</p>
<p>This is a test 8</p>
<p>This is a test 9</p>
<p>This is a test 10</p>
<p>This is a test 11</p>
<p>This is a test 12</p>
<p>This is a test 13</p>
<p>This is a test 14</p>
<p>This is a test 15</p>
<p>This is a test 16</p>
<p>This is a test 17</p>
</div>
关于javascript - 如何在 css 中开始滚动时重新创建 mac 滚动条淡入淡出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57274055/
我似乎对 git 存储库有权限问题。 当我 pull 入一个不是我的 Linux 用户创建的目录时,我出现了这个错误。 fatal: Unable to create '/home/---/.git/
在 Git 中,您可以将给定目录克隆到给定目录: git clone ssh://gitolite@dev.bipper.com:3687/com/bipper/kids/portal 当我运行我们
目前,如果您在分支 V2 中并执行“git pull origin V3”,它会将 V3 merge 到 V2,甚至不会发出警告或提示。这个选项可以以某种方式被阻止吗?我在这里阅读了所有类似的问题,人
我刚开始使用 Oracle 的 Coherence 缓存,我注意到这一点:如果我在缓存中放入一个 ConcurrentHashMap 对象,当我检索它时,我可以看到它被转换为一个普通的 HashMap
看起来我缺少对 git pull 和 git commit 的基本理解,假设我在分支上工作,而它在我更新时被其他开发人员更新了在本地做我的工作。我应该在发出 git pull 之前提交更改,还是应该执
好的。所以我以为我已经舔过了……但现在…… 我有一个项目,其中包含一个来自 GitHub 的小型库作为子模块。在该 super 项目的原始版本中,子模块按预期工作。 但是,我只是克隆了 super 项
使用 Visual Studio Code 中的内置 Git,我看不到将指定的远程分支 pull 入当前分支的方法。我可以这样做吗? 示例:我正在分支 myBranch 上工作,更改已 merge 到
当我尝试提交或 pull 此错误时 Bus error (core dumped) 发生了! 当我用 gdb 调试它时,(gdb git,run commit -a,where) 结果是: mucul
我对默认 Rails Rake 任务的预期用途有点困惑,想咨询一下我是否应该使用 db:reset或编写自定义 Rake 任务。没什么聪明的,只是日常管理,而且我很可能会错过一个明显的文档,因为我是
所以我做了: git reset --hard #commithash # make a bunch of changes, fixes and so on. git add -A git commi
我已使用以下命令成功部署到 firebase 托管应用: firebase init firebase deploy 在这个阶段,我正在执行 git pull 以将 repo 下 pull 到暂存服务
当尝试在 Eclipse 的 git 存储库中 pull (团队|从上下文菜单中 pull )时,出现 Could not get advertised Ref for branch refs/hea
我是一名优秀的程序员,十分优秀!