简体   繁体   English

Javascript / Ionic3溢出:在Firefox中隐藏了禁用滚动

[英]Javascript/Ionic3 Overflow:hidden disable scroll in Firefox

I have the problem that I cant remove the Scrollbars of Firefox Quantum. 我有无法删除Firefox Quantum滚动条的问题。 Oh Chrome it works like a charm whith this css: 哦,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;
}

Also I tried to remove it with jQuery and with adding it directly to the body tag like this style="overflow: hidden;" 我也尝试使用jQuery删除它,并将其直接添加到body标记中,例如style="overflow: hidden;"

Nothing of that works. 那没有用。 It seems I cant get rid of them. 看来我无法摆脱它们。 How can I remove them? 如何删除它们?

EDIT: 编辑:

with adding overflow: hidden; 加上overflow: hidden; to .scroll-content{} it removed the scrollbars but I cant scroll anymore on firefox. .scroll-content{}它删除了滚动条,但我无法在Firefox上滚动。 How can I enable scrolling with overflow: hidden; 如何启用带有溢出的滚动

You can do something like this. 你可以做这样的事情。

<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>

I'd create a fiddle but https://jsfiddle.net/ is down right now. 我会创建一个小提琴,但是https://jsfiddle.net/现在不可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM