html滚动悬停,html – 如何向滚动条添加额外的悬停效果

我可以看到,有几个理由说明为什么这不起作用.

你不能设置body :: – webkit-scrollbar-thumb的宽度.它将始终与body :: – webkit-scrollbar相同.

你无法改变body :: – webkit-scrollbar的宽度:hover.有或没有动画.

body::-webkit-scrollbar {

width: 0.7em;

}

body::-webkit-scrollbar:hover {

width: 0.9em; // Will be ignored

}

将设置关键帧规则的from值.但滚动条伪元素上的任何动画都不会播放.

body::-webkit-scrollbar-thumb {

background: yellow; // Scroll thumb is yellow

}

body::-webkit-scrollbar-thumb:hover {

-webkit-animation: scrollbig 1s;

}

// 0% = from,100% = to

@-webkit-keyframes scrollbig {

0% {background: red;} // Scroll thumb is red

1% {background: green;} // Will be ignored

100% {background: blue;} // Will be ignored

}

过渡也被忽略.

body::-webkit-scrollbar-thumb {

background: yellow; // Scroll thumb is yellow

transition: background 2s; // Will be ignored

}

body::-webkit-scrollbar-thumb:hover {

background: red; // Scroll thumb is red

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值