2016-12-14 71 views
0

嗨,我想讓滾動條出現在phonegap應用程序,但它只是不會出現。我已閱讀所有的線程。Phonegap滾動條

將這些設置在CSS樣式表中。我已經閱讀過你不能設置它們的線程?感謝您的時間

scrollbar { 
    -webkit-appearance: none; 
    width: 10px !important; 
} 

::-webkit-scrollbar { 
    width: 10px !important; 

} 
scrollbar:vertical { 
    width: 5px !important; 
} 
::-webkit-scrollbar:vertical { 
    width: 5px !important; 
} 
scrollbar:horizontal { 
    height: 2px !important; 
} 
::-webkit-scrollbar:horizontal { 
    height: 2px !important; 
} 

scrollbar-thumb { 
    background-color:#42c0fb !important; 
    border-radius: 5px !important; 
    border: 2px solid blue; 
    background-color:blue; 
} 
::-webkit-scrollbar-thumb { 
     background-color:#42c0fb !important; 
    border-radius: 5px !important; 

} 
scrollbar-track { 
    border-radius: 5px !important; 
    background-color: white !important; 
} 
::-webkit-scrollbar-track { 
    border-radius: 5px !important; 
    background-color: white !important; 
} 
+0

你嘗試以下方法:http://stackoverflow.com/a/1202542/2765346 它使滾動條總是可見的 –

+0

嗨,我只是嘗試過,但它仍然沒有出現。 – John

回答

1

我能夠這樣通過使用只拿到Android的應用Webkit滾動條CSS實現自己。

.android-scroll-bar ::-webkit-scrollbar {width: 5px;} 

.android-scroll-bar ::-webkit-scrollbar-track { border-radius: 10px;} 

.android-scroll-bar ::-webkit-scrollbar-thumb { border-radius: 10px; background: rgb(169,169,169); } 

.android-scroll-bar ::-webkit-scrollbar-thumb:window-inactive {background: rgb(128,128,128); } 

而對於顯示滾動條,你必須安裝科爾多瓦人行橫道插件:我用

$('html').addClass('android-scroll-bar');

這裏是必要的CSS添加Android的滾動條類Android上的網頁。 對於PhoneGap,也可能有人行橫道插件。

+0

我只想提一下,因爲它可以很容易被忽略,但特別是人行橫道插件是我的伎倆。 – Allan