本文介紹了Ionic 2:隱藏滾動條并繼續滾動的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我只想在需要滾動的頁面中隱藏滾動條.我正在使用離子 2
I just want to hide the scrollbar, in a page that needs scrolling. I am using Ionic 2
我的不起作用解決方案:
.scroll-content-bar{
overflow: hidden;
}
此解決方案隱藏滾動條但使屏幕無法滾動.
This solution hide the scroll-bar but makes the screen unscrollable.
推薦答案
首先,改變瀏覽器的自然行為和預期的用戶體驗是一個冒險的舉動.
First and foremost, changing natural behavior of the browser and expected user experience is a risky move.
但是,如果您仍然真的很想這樣做,我認為您最好的選擇是偽造它.在這種情況下,將 width
設置為 0 就足夠了,但我還將背景顏色更改為完全透明.
However, if you still really really want to, I think your best bet is to fake it. In this case, setting width
to 0 should be enough but I'm also changing background colors to be completely transparent.
div{
background: gray;
height: 200px;
overflow-y: scroll;
}
p{
border-bottom: 1px solid black;
}
div::-webkit-scrollbar {
border:none;
width:0;
background: rgba(0,0,0,0);
}
div::-webkit-scrollbar-track {
border:none;
width:0;
background: rgba(0,0,0,0);
}
div::-webkit-scrollbar-thumb {
border:none;
width:0;
background: rgba(0,0,0,0);
}
<div>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
</div>
這篇關于Ionic 2:隱藏滾動條并繼續滾動的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!