jQuery UI スライダー コントロールを使用します。私のスライダーの幅は200px
です。左ハンドルの中心を右にシフトし14px
、右ハンドルの中心を左にオフセットしたいと思います14px
。
172px
私のスライダーは( )以上になります200 -14 - 14
。background-image
対策200px
。_ の長さは14px
次のように計算されます。
width of the handle (28px) / 2
私はデフォルトmargin-left: 0px;
で削除するために使用しmargin-left:-14px
ます。でも、右ハンドルが右に動く28px
!
この謎を解くのを手伝ってくれませんか?
.ui-slider .ui-slider-handle {
width: 28px;
height: 28px;
background: url(http://hitskin.com/themes/13/67/44/i_right_arrow.png) no-repeat 0 0;
overflow: hidden;
position: absolute;
margin-left: 0;
top: -7px;
border-style: none;
cursor: help;
}