2013-12-12 54 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/ –