Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css tinyscrollbar不显示_Css_Web_Tinyscrollbar - Fatal编程技术网

Css tinyscrollbar不显示

Css tinyscrollbar不显示,css,web,tinyscrollbar,Css,Web,Tinyscrollbar,我很困惑,我想用插件tinyscrollbar制作一个侧边栏,我希望视口的“高度”为“100%”,但是如果我更改css,那么内容就不会出现,你能给我另一个解决方案吗 这是tinyscrollbar的默认代码,但我更改了视口的“高度”: #scrollbar1 { width: 520px; margin: 20px 0 10px; } #scrollbar1 .viewport { width: 500px; height: 100%; overflow: hidden; posit

我很困惑,我想用插件tinyscrollbar制作一个侧边栏,我希望视口的“高度”为“100%”,但是如果我更改css,那么内容就不会出现,你能给我另一个解决方案吗

这是tinyscrollbar的默认代码,但我更改了视口的“高度”:

#scrollbar1 { 
width: 520px; 
margin: 20px 0 10px; }
#scrollbar1 .viewport { 
width: 500px; 
height: 100%; 
overflow: hidden; 
position: relative; }
#scrollbar1 .overview {
height:100%;
list-style: none; 
position: absolute; 
left: 0; 
top: 0; 
padding: 0; 
margin: 0; }
#scrollbar1 .scrollbar{ 
background: transparent url(../images/bg-scrollbar-track-y.png) no-repeat 0 0; 
position: relative; 
background-position: 0 0; 
float: right; 
width: 15px;
height:100% }
#scrollbar1 .track { 
background: transparent url(../images/bg-scrollbar-trackend-y.png) no-repeat 0 100%; 
height: 100%;
width:13px; 
position: relative; 
padding: 0 1px; }
#scrollbar1 .thumb { 
background: transparent url(../images/bg-scrollbar-thumb-y.png) no-repeat 50% 100%; 
height: 20px; width: 25px; 
cursor: pointer; 
overflow: hidden; 
position: absolute; 
top: 0; 
left: -5px; }
#scrollbar1 .thumb .end { 
background: transparent url(../images/bg-scrollbar-thumb-y.png) no-repeat 50% 0; 
overflow: hidden; 
height: 5px; 
width: 25px; }
#scrollbar1 .disable { 
display: none; }
.noSelect { 
user-select: none; 
-o-user-select: none; 
-moz-user-select: none; 
-khtml-user-select: none; 
-webkit-user-select: none; }

你不能使它成比例(百分比),你需要一个固定的值。使用jQuery或类似工具确定实际高度,然后将其用作固定像素高度值。这是我能提供的最好建议。此外,您可能需要在调整窗口大小时做出反应

现在我正在使用移动设备,所以我不能给你任何代码示例;但是,您可以像“使用jquery设置高度”和“使用jquery确定100%高度”那样在谷歌上搜索它。。。但是,首先,如果固定高度真的起作用,你应该试试。也许我弄错了。谢谢,先生。。!我一直在浏览,已经得到了解决方案,但当我尝试在css中更改为“固定”位置时,滚动条可见,但内容不可见。那么,可能滚动条模块有问题:(很多时候,他们通过添加一个绝对div来工作,可能它覆盖了您要滚动的所有区域,并且由于某种原因它是空的……老实说,我不知道。很抱歉,我无法提供进一步的帮助。通过将viewport的高度设置为100%,您希望实现什么?