Hide the scrollbar but keep the ability to scroll with native feel

前端 未结 4 1254
庸人自扰
庸人自扰 2021-01-18 08:04

I\'ve searched for an answer to this question and came across hide scrollbar while still able to scroll with mouse/keyboard but the jQuery plugin doesn\'t quite do what I\'d

相关标签:
4条回答
  • 2021-01-18 08:07

    This works for me:

        body{
            overflow:hidden;
        }
    
    0 讨论(0)
  • 2021-01-18 08:09

    That is standard browser behavior.

    Taking away scrollbar reduces user-friendliness.


    You can set scrollbar to stay visible all the time with css.

    CSS:

    body {
        overflow-y: scroll;
    }
    
    0 讨论(0)
  • 2021-01-18 08:09

    Just for completeness sake, to answer your question, here is the scrollable page without scrollbar.

    Note that this is not preferred, and I would also force the scrollbar as Lobello already answered.

    0 讨论(0)
  • 2021-01-18 08:11

    If you really want to disable the scrolling (In a frameset, the worst possible place for scrolling) then use scrolling=no.

    0 讨论(0)
提交回复
热议问题