最近在做PC端项目时,由于滚动条比较影响美观,所以查阅了一些资料,把滚动条做了隐藏,下面做一下总结。
/*webkit内核*/
.scroll_content::-webkit-scrollbar {
width:0px;
height:0px;
}
/*o内核*/
.scroll_content .-o-scrollbar{
-moz-appearance: none !important;
background: rgba(0,255,0,0) !important;
}
/*IE10,IE11,IE12*/
.scroll_content{
-ms-scroll-chaining: chained;
-ms-overflow-style: none;
-ms-content-zooming: zoom;
-ms-scroll-rails: none;
-ms-content-zoom-limit-min: 100%;
-ms-content-zoom-limit-max: 500%;
-ms-scroll-snap-type: proximity;
-ms-scroll-snap-points-x: snapList(100%, 200%, 300%, 400%, 500%);
-ms-overflow-style: none;
overflow: auto;
}
/*火狐需要JQ实现*/
<script src="lib/jquery.min.js"></script>
<script src="lib/jquery.nicescroll.min.js"></script>
$(function(){
$(".scroll_content").niceScroll({cursorborder:"",cursorcolor:"rgba(0,0,0,0)",boxzoom:true});
})