行爲工作在Windows機器上如預期,但它出現的MacOS和iOS有自己的滾動條的處理。您可以在this question中看到此問題。
一些答案中列出的選項是手工風格的滾動條,像這樣:
.frame::-webkit-scrollbar {
-webkit-appearance: none;
}
.frame::-webkit-scrollbar:vertical {
width: 11px;
}
.frame::-webkit-scrollbar:horizontal {
height: 11px;
}
.frame::-webkit-scrollbar-thumb {
border-radius: 8px;
border: 2px solid white; /* should match background, can't be transparent */
background-color: rgba(0, 0, 0, .5);
}
.frame::-webkit-scrollbar-track {
background-color: #fff;
border-radius: 8px;
}
您還可以使用JavaScript來手動滾動頁面加載的滾動條,只需單個像素。像這樣:
$('#scrollable-section').scrollTop(1).scrollTop(0);
它似乎在Chrome中工作正常。你有什麼瀏覽器遇到問題? –
鉻。哈哈。你能看到它之前滾動? – AndrewLeonardi
我在加載後立即看到它。 –