无论我尝试什么方法,滚动条轨道都会显示并隐藏下面的内容。我希望看到下面的内容 - 不要与总是看到轨道相混淆。
我还是想看看拇指。
理想结果:http://lab.cubiq.org/iscroll/examples/simple/
我尝试过的事情:
::-webkit-scrollbar-track {
display: none !important;
}
不起作用,滚动条轨道仍然显示,隐藏了下面的内容。
::-webkit-scrollbar-track-piece:start {
background: transparent url('http://myServer/transparent.png') repeat-y !important;
}
::-webkit-scrollbar-track-piece:end {
background: transparent url('http://myServer/transparent.png') repeat-y !important;
}
同样的故事
::-webkit-scrollbar-track {
background:transparent;
border-radius: 0px;
}
不起作用
最佳答案
这应该有效,但请注意它仅适用于 Chrome 并且隐藏了拇指。查看您的示例,我认为这就是您想要的。
::-webkit-scrollbar {
display: none;
}
如果你不想隐藏你的拇指,你为什么不试试这个:
html{
height: 100%;
width: 100%;
overflow: hidden;
}
body{
height: 100%;
width: 100%;
overflow: auto;
padding-right: 17px; /* keep it as 0 initially & check OR Increase/Decrease this value for cross-browser compatibility */
}
注意:padding-right
大多数时候可能不是必需的。
关于html - 透明滚动条轨道(div),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39353252/