見我不喜歡丟失了JQuery
與AngularJS
就在這個美麗的東西Don't augment jQuery with AngularJS
可以實現垂直和水平滾動條等作爲所示看看下面。
Working Demo
HTML
<div class="scrollbar-container">
<div class="inner">
<p>Content Here........</p>
</div>
</div>
CSS
.scrollbar-container {
position: absolute;
top: 0; bottom: 0; left: 0; right: 0;
margin: 20px;
border: 4px solid rgba(0, 0, 0, 0.2);
overflow: auto;
background-color: whiteSmoke;
}
.scrollbar-container .inner {
height: 2011px;
padding: 1em;
background-color: white;
font-family: sans-serif;
}
::-webkit-scrollbar {
background: transparent;
border: rgba(0, 0, 0, 0.2) solid;
}
::-webkit-scrollbar:vertical {
border-width: 0 0 0 1px;
width: 11px;
}
::-webkit-scrollbar-corner {
background: transparent;
}
/* These rules are for scrollbar draggable panel */
::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.2);
box-shadow: 0 0 2px rgba(0, 0, 0, 0.3) inset;
}
::-webkit-scrollbar-thumb:hover {
background-color: rgba(0, 0, 0, 0.3);
}
::-webkit-scrollbar-thumb:active {
background-color: rgba(0, 0, 0, 0.5);
}
/* These rules are for buttons */
::-webkit-scrollbar-button:start{display:none}
::-webkit-scrollbar-button:end{display:none}
看看我的回答 –