样式webkit滚动条在某种状态 [英] Style webkit scrollbar on certain state

查看:120
本文介绍了样式webkit滚动条在某种状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的 WebKit滚动条具有不同的颜色,它的容器被盘旋。我想让整个滚动条点亮。



我在想像这样会做的伎俩(但不是):

  .scroller:hover ::  -  webkit-scrollbar {
background:green;
}

我对滚动条的风格一样: .scroller ,而不是全局。 (工作原理: .scroller :: - webkit-scrollbar )我想溢出的div是特殊的,而不是文档。



另一个(相关)问题:将鼠标悬停在滚动条上时点亮拇指。这不起作用:

  .scroller ::  -  webkit-scrollbar:hover ::  -  webkit-scrollbar-thumb 


解决方案

更改背景颜色对我来说很好。 >

http://jsfiddle.net/QcqBM/1

  div#container:hover ::  -  webkit-scrollbar {
background:lightyellow;
}

您确定您的CSS调用没有其他错误吗? / p>

I'd like my WebKit scrollbars to have a different color when its container is hovered over. I want the entire scrollbar to light up.

I was thinking something like this would do the trick (but it doesn't):

.scroller:hover::-webkit-scrollbar {
  background: green;
}

I've styled the scrollbars the same way: on .scroller, not globally. (That works: .scroller::-webkit-scrollbar) I want the overflowed divs special, not the document.

Another (related) problem: light up the thumb when hovering over the scrollbar. This doesn't work:

.scroller::-webkit-scrollbar:hover ::-webkit-scrollbar-thumb

解决方案

Changing the background color works just fine for me.

http://jsfiddle.net/QcqBM/1

div#container:hover::-webkit-scrollbar {
    background: lightyellow;
}

Are you sure there isn't something else wrong with your CSS call?

这篇关于样式webkit滚动条在某种状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆