自定义jScrollPane滚动条可能拖得太低

时间:2013-03-05 17:02:06

标签: javascript jquery html css jscrollpane

我正在创建一个自定义的jScrollPane滚动条,我无法找到限制垂直拖动距离的方法,以防止它在div切断的位置下方滚动。

请参阅http://jsfiddle.net/wE8ry/

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%;
}

1 个答案:

答案 0 :(得分:0)

您的问题源于您对.jspdrag所做的更改: box-shadow: 0px 0px 2px 2px #985400;

我认为你的黑客只有4个像素。