我正在创建一个自定义 jScrollPane 滚动条,但我无法找到一种方法来限制垂直拖动距离以防止它滚动到 div 切断的位置以下。
body
{
background: black;
}
.scroll-pane
{
width: 300px;
height: 250px;
overflow: auto;
background: black;
color: white;
}
.jspContainer
{
overflow: hidden;
position: relative;
}
.jspPane
{
position: absolute;
}
.jspVerticalBar
{
position: absolute;
top: 2px;
right: 3px;
width: 5px;
height: 100%;
background: red;
}
.jspHorizontalBar
{
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 5px;
background: red;
}
.jspVerticalBar *,
.jspHorizontalBar *
{
margin: 0;
padding: 0;
}
.jspCap
{
display: none;
}
.jspHorizontalBar .jspCap
{
float: left;
}
.jspTrack
{
background: black;
position: relative;
}
.jspDrag
{
background: #fccb00;
position: relative;
top: 0;
left: 0;
cursor: pointer;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
border-radius: 2px;
-webkit-box-shadow: 0px 0px 2px 2px #985400;
-moz-box-shadow: 0px 0px 2px 2px #985400;
box-shadow: 0px 0px 2px 2px #985400;
}
.jspHorizontalBar .jspTrack,
.jspHorizontalBar .jspDrag
{
float: left;
height: 100%;
}
.jspArrow
{
background: #50506d;
text-indent: -20000px;
display: block;
cursor: pointer;
}
.jspArrow.jspDisabled
{
cursor: default;
background: #80808d;
}
.jspVerticalBar .jspArrow
{
height: 16px;
}
.jspHorizontalBar .jspArrow
{
width: 16px;
float: left;
height: 100%;
}
.jspVerticalBar .jspArrow:focus
{
outline: none;
}
.jspCorner
{
background: #eeeef4;
float: left;
height: 100%;
}