2012-02-14 73 views
1

目前不需要跨瀏覽器,只需webkit即可。我熟悉:: - webkit滾動條樣式的能力,但我怎樣才能使用這個或JavaScript來使滾動條遵守元素的邊界半徑?將邊界半徑應用於滾動條:: - webkit-scrollbar CSS3

我有一個DIV與邊界半徑:

#tagBox { 
    border-radius: 20px; 
} 
#tagBox::-webkit-scrollbar-??? { 
    ???: ??? 
} 

如何使滾動條服從元素的邊界半徑?即使它需要JavaScript。 (我已經嘗試過LionBars插件和jScrollPane,結果是可憐的bug)

謝謝!

回答

2

希望這個例子可以幫助你:http://trac.webkit.org/export/41842/trunk/LayoutTests/scrollbars/overflow-scrollbar-combinations.html

我想你錯過了這些東西:

::-webkit-scrollbar { 
    width: 13px; 
    height: 13px; 
} 
::-webkit-scrollbar-track { 
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); 
    border-radius: 10px; 
} 

::-webkit-scrollbar-thumb { 
    border-radius: 10px; 
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); 
} 

更好地瞭解你可以按照這個小提琴:http://jsfiddle.net/Sfy9p/3/