开发者

YUI range slider separate ticksize for subranges

My requirement is typical. I need a price range dual-handle slider, where based on the current handle value, the tick size (step size) will change, for example if price is less that 1500, the tick size is 50. between 1500 and 15000, the tick size should become 100, between 15000 to 50000 the tick size should become 500, and so on. I have achieved this with jquery, but there are other issues (like auto adjust of the other handle), which I cannot solve. I am now using YUI. is there a way to change the tick si开发者_如何学编程ze based on the value of the current handle? any help is welcome.


Presuming you mean the pixel distance the thumb hops when dragged, try this:

var thumb = dualSlider.maxSlider.thumb;
thumb.setXConstraint(thumb.leftConstraint, thumb.rightConstraint, newTickSize);

If you mean the value that corresponds to the thumb placement uses a different conversion factor from pixel position to "real" value, that would need to be implemented in the function you built to do that translation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜