简体   繁体   English

CSS:隐藏滚动条。

[英]CSS: Hide Scrollbar.

I know how to hide scroll bar. 我知道如何隐藏滚动条。 But without a scroll bar , I would like to scroll whatever there is to scroll. 但是没有滚动条 ,我想滚动任何要滚动的东西。
This is what I did, it hides initially, and as mouse hovers, vertical scroll bar shows. 这就是我所做的,它最初是隐藏的,并且当鼠标悬停时,会显示垂直滚动条。

div#LogoStrip{
    height:600px;
    overflow:hidden;
}

div#LogoStrip:hover{
    overflow-y:scroll;
    overflow-x:hidden;
}


But on hover , I don't want to see scrollbar but still would like to scroll the text/images that are present there , using wheel or two small buttons, 1 at top and 1 at bottom. 但是在悬停时 ,我不想看到滚动条,但仍想使用滚轮或两个小按钮(顶部为1,底部为1) 滚动显示此处的文本/图像

div#LogoStrip{
        height:600px;
        overflow:hidden;
    }

+ javascript + javascript

can you help with Javascript/jQuery ? 您可以使用Javascript / jQuery帮助吗?

您可以使用jQuery通过jScrollPane或其他类似插件来实现自己的自定义滚动条。

If you really want to code this yourself (and I would again caution against it), you can look through the jScrollPane code. 如果您真的想自己编写此代码(我会再次警告它),则可以浏览jScrollPane代码。 The basic idea is that you have a div within a div, one will hid the contents of the other when set to an offset. 基本思想是,在div中有一个div,当设置为偏移量时,一个将隐藏另一个的内容。 You have to capture the scroll wheel event and change that offset. 您必须捕获滚轮事件并更改该偏移量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM