OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <style> |
| 3 ::-webkit-scrollbar { |
| 4 height: 10px; |
| 5 width: 10px |
| 6 } |
| 7 ::-webkit-scrollbar-thumb { |
| 8 background: rgba(255,0,0,0.8); |
| 9 } |
| 10 html { |
| 11 overflow-y: scroll; |
| 12 } |
| 13 </style> |
| 14 <div style="height:700px"></div> |
| 15 <script> |
| 16 var styleElement = document.createElement("style"); |
| 17 var sheet = document.head.appendChild(styleElement).sheet; |
| 18 function addRule(selector, css){ |
| 19 var propText = Object.keys(css).map(function(p){ |
| 20 return p+":"+css[p] |
| 21 }).join(";"); |
| 22 sheet.insertRule(selector + "{" + propText + "}", sheet.cssRules.length); |
| 23 }; |
| 24 document.body.offsetTop; |
| 25 addRule("::-webkit-scrollbar-thumb", {background: "rgba(13,53,178,0.8)",}); |
| 26 </script> |
OLD | NEW |