0
我的iframe上的滾動條不會保持可見狀態。它在iframe首次加載時出現,然後消失。始終顯示iframe垂直滾動條
我曾嘗試:
- 把SCROLLING = 「是」 在iframe標籤
- 添加溢出:-moz-滾動條垂直於CSS
- 將溢出-Y:滾動在CSS
這些都不起作用。
#iframe {
overflow: -moz-scrollbars-vertical !important;
overflow-y:scroll;
}
<iframe class="iframeclass" id="frame" src="" width="650" height="350" frameBorder="0" scrolling="yes"></iframe>
我認爲這是一個Mac問題,因爲許多Mac用戶禁用垂直滾動條,因爲他們只是使用觸控板。我嘗試以下(從這個answer):
.iframeclass::-webkit-scrollbar {
-webkit-appearance: none;
}
.iframeclass::-webkit-scrollbar:vertical {
width: 11px;
}
.iframeclass::-webkit-scrollbar:horizontal {
height: 11px;
}
.iframeclass::-webkit-scrollbar-thumb {
border-radius: 8px;
border: 2px solid white; /* should match background, can't be transparent */
background-color: rgba(0, 0, 0, .5);
}
.iframeclass::-webkit-scrollbar-track {
background-color: #fff;
border-radius: 8px;
}
但仍然無法正常工作。
你能提供你的代碼? –
現在檢查答案 –
與-webkit-scrollbar一起工作的css片段對我來說就像一個魅力 – caroso1222