退房雅虎UI他們有一個滑塊控件:http://developer.yahoo.com/yui/slider/
下面的例子應該讓你開始:http://developer.yahoo.com/yui/examples/slider/slider-ticks.html
所有的JavaScript框架(jQuery, MooTools)似乎提供了一個滑塊,YUI會給你很多控制權和一個加載器,所以你不必在你的服務器上託管腳本,注意YUI並沒有像我提到的另外兩個。
下面是一個MooTools的例子:
// First example of http://demos.mootools.net/Slider
<div class="slider" id="myslider">
<div class="knob" style="position: relative;"/>
</div>
和JavaScript:
var el = $('myslider'); // The slider graphic
new Slider(el, el.getElement('.knob'), {
steps: 7, // There are 7 choices
range: [1, 7], // Minimum value is 1, maximum is 7
onChange: function(value){
// Calculation of the value goes here
}
});