Javascript/Ionic3 溢出 :hidden disable scroll in Firefox

标签 javascript jquery css firefox

我遇到无法删除 Firefox Quantum 滚动条的问题。哦 Chrome 它就像这个 css 的魅力一样:

 div::-webkit-scrollbar {
  border:none;
  width:0;
  background: rgba(0,0,0,0);
  display: none;
  overflow-x: hidden;
  overflow-y: hidden;
}

div::-webkit-scrollbar-track {
  border:none;
  width:0;
  background: rgba(0,0,0,0);
  display: none;
  overflow-x: hidden;
  overflow-y: hidden;
}

div::-webkit-scrollbar-thumb {
  border:none;
  width:0;
  background: rgba(0,0,0,0);
  display: none;
  overflow-x: hidden;
  overflow-y: hidden;
}

我还尝试使用 jQuery 将其删除,并将其直接添加到正文标签中,如下所示 style="overflow: hidden;"

这些都不起作用。看来我无法摆脱它们。 我怎样才能删除它们?

编辑:

通过添加 overflow: hidden;.scroll-content{} 它删除了滚动条,但我不能再在 firefox 上滚动了。如何启用溢出滚动:隐藏;

最佳答案

你可以这样做。

<style>
    #container{
        height: 500px;
        width: 200px;
        background-color: #ccc;
        overflow: hidden;
    }
    #container-inner{
        width: calc(100% + 17px);
        height: 100%;
        overflow: scroll;
        overflow-x: hidden;
    }
    .content{
        width: 100%;
        height: 300px;
    }
    .one{
        background-color: red;
    }
    .two{
        background-color: green;
    }
    .three{
        background-color: yellow;
    }
</style>
<div>
    <div id="container">
        <div id="container-inner">
            <div class="content one">
            </div>
            <div class="content two">
            </div>
            <div class="content three">
            </div>
        </div>
    </div>
</div>

我会创建一个 fiddle ,但是 https://jsfiddle.net/现在正在下降。

关于Javascript/Ionic3 溢出 :hidden disable scroll in Firefox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47327299/

相关文章:

javascript - 更好的嵌套对象引用语法?

html - 位置跨度内联 block 在 div 的底部

javascript - 使全框阴影支持百分比

javascript - 如何在 iframe 中添加包含 jquery 脚本的 html 页面的结果

html - 当页眉和页脚的宽度为 100% 时,iPhone 在将页面居中时无法正确呈现页面

html - 即使使用 CSS Reset,Div 也不会触及浏览器的顶部

javascript - AngularJS 作用域变量设置不正确

javascript - 使用 grunt 在 Angular 指令中调用 js 文件

javascript - 如何在数据库中存储和重用传单 LatLngs

javascript - 按钮组单击处理程序 - 如何获取单击按钮的文本内容?