2013-12-12 53 views
1

我有以下的代碼,自定義WebKit的滾動條....火狐 - 定製滾動條

/*webkit scroll bar*/ 

::-webkit-scrollbar { 
    width: 6px; 
} 


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


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

我想要做的是定製在Firefox加載同樣的方式在頁面的滾動條。 ..對於我嘗試下面的代碼..

/*mozilla scroll bar*/ 

::-moz-scrollbar { 
    width: 6px; 
} 


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


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

,但它不工作.....我怎麼可以自定義以同樣的方式我做了WebKit的滾動條...任何幫助,將不勝感激...預先感謝... :)

+3

Firefox不會有這樣的事情(再說,你甚至沒有將所有的前綴)。 – BoltClock

+0

所以...基本上你想說的是我不能做到這一點... – Sajeeb

回答

-1

試試這個曾經

用於Firefox - 自定義滾動條

@-moz-document url-prefix(http://),url-prefix(https://) { 

scrollbar { 
    -moz-appearance: none !important; 
    background: rgb(0,255,0) !important; 
} 
thumb,scrollbarbutton { 
    -moz-appearance: none !important; 
    background-color: rgb(0,0,255) !important; 
} 

thumb:hover,scrollbarbutton:hover { 
    -moz-appearance: none !important; 
    background-color: rgb(255,0,0) !important; 
} 

scrollbarbutton { 
    display: none !important; 
} 

scrollbar[orient="vertical"] { 
    min-width: 15px !important; 
} 
} 
+0

我什麼都沒有... – Sajeeb

+0

http://codemug.com/html/custom-scrollbars-using-css/ –

+0

這裏有一些插件,對於所有瀏覽器的工作原理: 1. http://jscrollpane.kelvinluck.com/ 2. http://www.hesido.com/web.php?page=customscrollbar 3. HTTP:/ /www.script-tutorials.com/custom-scrollbars-cross-browser-solution/ –