【问题标题】:How to make a scroll area hide x & y both scroll bar, but only enable horizontal scroll?如何使滚动区域隐藏 x 和 y 滚动条,但只启用水平滚动?
【发布时间】:2013-06-19 03:02:58
【问题描述】:

如何让滚动区域隐藏x&y两个滚动条,但只启用水平滚动?

http://jsbin.com/opunut/5/edit

这里有一个演示 http://jsbin.com/acexuq/1/edit 但它是垂直的,如果我设置 wrap overflow-y: hidden;溢出-x:滚动;内容浮动:左,内容不能滚动..

我找到了这个答案https://stackoverflow.com/a/2597343/1927742,但它无法隐藏滚动条...

有什么建议或更好的主意吗?

【问题讨论】:

    标签: jquery css


    【解决方案1】:

    尝试在外部和内部之间添加一个名为中间的额外 div 并使用此 CSS:

    http://jsbin.com/acexuq/3/

    #outer {
      overflow:hidden;
      width: 400px;
      height: 400px;
    }
    #inner {
      overflow:auto;
      width:4000px; 
      height:400px;
    }
    #middle {
      overflow: scroll;
      width:417px; 
      height:417px;
    }
    

    【讨论】:

      猜你喜欢
      • 2017-06-26
      • 2017-11-06
      • 1970-01-01
      • 2020-10-18
      • 1970-01-01
      • 1970-01-01
      • 2014-04-07
      • 2020-08-18
      • 2013-04-23
      相关资源
      最近更新 更多