CSS webkit scrollbar show/hide

后端 未结 5 959
萌比男神i
萌比男神i 2021-01-31 21:47

I\'m using -webkit-scrollbar and what I want to happen is the scrollbar hidden on page load, and it stays hidden until you hover over the container div it is attached to. When y

5条回答
  •  攒了一身酷
    2021-01-31 22:28

    I seem to have got through the auto hide thing in css. I somehow did it on my app, and was searching how I got it. Here it is, a modification to the existing fiddle by @tim

    http://jsfiddle.net/4RSbp/165/

    This does the trick:

    body {overflow-y:hidden;}
    body:hover {overflow-y:scroll;}
    

提交回复
热议问题