admin管理员组文章数量:1316030
I have a web page with infinite scrolling. I always want to have the vertical scrollbar present so I have added the following style:
html {
overflow-y: scroll;
}
This works in that it shows the scrollbar but it just displays an empty scrollbar, i.e. there is no cursor to allow the user to scroll up or down.
Is it possible to not only display the scrollbar but also have the cursor displaying as well?
I have a web page with infinite scrolling. I always want to have the vertical scrollbar present so I have added the following style:
html {
overflow-y: scroll;
}
This works in that it shows the scrollbar but it just displays an empty scrollbar, i.e. there is no cursor to allow the user to scroll up or down.
Is it possible to not only display the scrollbar but also have the cursor displaying as well?
Share Improve this question edited Jul 3, 2012 at 13:50 John Conde 220k99 gold badges462 silver badges501 bronze badges asked Jul 3, 2012 at 13:49 dagda1dagda1 29k67 gold badges255 silver badges477 bronze badges 2- If the content doesn't scroll then the scroll bar will be empty. :P – uadnal Commented Jul 3, 2012 at 13:51
- What do you mean by "infinite scrolling"? You have content that never ends? Normally, the cursor (I assume you mean the slider element that indicates where you are currently located within the element) will appear as soon as some of the content has overflowed the element on the specified axis. – AmericanUmlaut Commented Jul 3, 2012 at 13:53
2 Answers
Reset to default 9Make the html a bit higher and the scroll will show up
html {
overflow-y: scroll;
height: 101%
}
It's a bit hard to say with the limited information you've provided. What javascript/plugin are you using to achieve infinite scrolling?
My gut instinct is that the infinite scroll may be happening in an element below the top-level html element. Maybe try using your browser's developer's tools to identify which element is actually scrolling, and applying the "overflow-y: scroll;" to that.
Be warned, you may find that the reason they hide the vertical scroll-bar is that the plugin you're using makes it meaningless. If the system deletes old elements from the top of the page so as to not run out of memory, scrolling to the top of the scroll-bar may not take you to the top of the page.
本文标签: javascriptHave the vertical scroll bar always present cssStack Overflow
版权声明:本文标题:javascript - Have the vertical scroll bar always present css - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741983514a2408537.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论