Html
    Css
    Js

    
                        
 .gdtCont {
	width:200px;
	height:300px;
	border:1px solid #ccc;
	overflow:hidden;
	margin:0 auto;
	position:relative;
}
.txtCont {
	width:220px;
	height:100%;
	overflow:auto;
	box-sizing:border-box;
	padding-left:20px;
}
.bz-gdtCon {
	width:6px;
	position:absolute;
	top:0;
	right:0;
	background:rgba(0,0,0,.5);
	height:100%;
	display:none;
}
.bz-chtgn {
	width:100%;
	position:absolute;
	top:0;
	left:0;
	background:rgba(255,255,255,.5);
}

                        
↑上面代码改变,会自动显示代码结果 jQuery调用版本:2.1.4
 立即下载

自定义滚动条

自定义滚动条,关键是在计算滚动条比例上

0