我有一个滑块,我希望能够仅在 x 坐标中拖动,并设置不能拖动形状的约束(形状不应在两个方向上超出线)。如何实现?
JS小提琴链接
window.onload = function(){
var paper = Raphael(0,0,700,150);
var sliderline = paper.rect(68,100,606,1).attr({fill:'red',stroke:'none'});
var slider = paper.rect(100,98,18,7,4).attr({fill:'#7cc576','stroke-width':'2','stroke':'white'}).glow({width:1,opacity:10,color:'green'});
}
</p>