Webkit scrollbar dynamic styling

后端 未结 8 1838
清歌不尽
清歌不尽 2021-01-04 00:15

I\'m currently styling the scrollbar using Webkit\'s ::-webkit-scrollbar CSS properties and would like to change these properties on a mousemove event. The problem is that I

8条回答
  •  梦毁少年i
    2021-01-04 00:27

    Yes, you can do it.

    You need to include dynamically css style rule into stylesheet. And then to change it.

    You can do it by this plugin

    If you don't need to use jQuery - you can do it by pure Javascript: link 1 link 2. But there is cross-browser problems.

    Also see Setting CSS pseudo-class rules from JavaScript

提交回复
热议问题