滚动条自定义效果在IE和Firefox中不存在

时间:2014-03-12 11:21:39

标签: html css internet-explorer firefox webkit

我的项目需要此滚动条(图片给出),

enter image description here我将此应用于我的css

::-webkit-scrollbar {
      width: 8px;
}

::-webkit-scrollbar-track {
      background-color: #FFFFFF;
} /* the new scrollbar will have a flat appearance with the set background color */

::-webkit-scrollbar-thumb {
      background-color: rgba(242,91,32,0.9); 
} /* this will style the thumb, ignoring the track */

::-webkit-scrollbar-corner {
      background-color: #FFFFFF;
}

但是当我检查我的页面时,只有chrome显示效果Firefox(27.0.1)和Internet Explorer(10for)没有响应更改。我必须添加以便它们对所有这些都变得一致吗?

2 个答案:

答案 0 :(得分:0)

firefox和IE没有自定义滚动条的功能

答案 1 :(得分:0)

正如N.Nihar在评论中提到的,当前版本的Firefox和Internet Explorer不支持滚动条自定义。

如果你需要设置滚动条的样式,你可能想要使用自定义的Javscript或者甚至更好的基于jQuery的滚动条元素。第一个显示在Google搜索中的是Stack Overflow answer,或者您可以使用Tiny scrollbar,或this list。有很多基于Javascript和jQuery的滚动条随时可用。

但是,如果您确实使用其中一个,请务必彻底测试您的解决方案,因为“原生”滚动条的行为并不容易模仿。

相关问题