跨浏览器滚动条自定义 [英] Cross Browser Scrollbar customization
问题描述
我想让我的滚动条颜色改变,我在线阅读几个例子。但是它们与webkit浏览器相关,并且在-moz浏览器中不起作用。我发现一个jquery插件的所有浏览器称为'jquery自定义滚动条',但它有3-4外部文件,我不想要。我需要加载它在我的一个html页面,所以它工作相同的同一浏览器。
所以,我的div.container包含数据,我想它滚动(轨道)是灰色的。
简短的答案:你不能。
Long(ish)答案:浏览器和操作系统都有不同的实现,有些不支持主题滚动条。您可以使用此类库创建自定义滚动条: http://jscrollpane.kelvinluck.com/ P>
I want to have my scroll bar color changed, I read couple of example online. But they relate to webkit browsers, and that doesn't work in -moz browser. I found a jquery plugin for all browsers called 'jquery custom scrollbar', but it got 3-4 external files, which i don't want. I need to load it in my one html page, so it work the same across same browser.
So, my div.container is containing data, i want it scroll (track) to be grey color. How can i do it across all latest browsers?
Short answer: You can't.
Long(ish) answer: Browsers and operating systems all have different implementations, and some just don't support theming the scroll bar. You could create custom scrollbars with a library like this though: http://jscrollpane.kelvinluck.com/
这篇关于跨浏览器滚动条自定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!