2012-10-17 28 views

回答

4

您的示例缺少樣式表。 dojox/form/RangeSlider隨附一個,在dojox/form/resources下找到。

地址:

<link rel="stylesheet" 
href="http://ajax.googleapis.com/ajax/libs/dojo/1.8/dojox/form/resources/RangeSlider.css" 
/> 

你的HTML輸出

http://jsfiddle.net/g78Uk/1/

1

這裏是用尺子小提琴的改進版本,編程添加。

var sliderRules = new dijit.form.HorizontalRuleLabels({ 
     minimum: 0, 
     maximum: 12, 
     labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], 
     labelStyle: "font-size:9px;color: #333", 
     style: "width:300px;height:30px;" 
    }, "ruler"); 


    var rangeSlider = new dojox.form.HorizontalRangeSlider({ 
     name: "rangeSlider", 
     value: [2, 6], 
     minimum: 0, 
     maximum: 12, 
     discreteValues: 12, 
     style: "width:300px;", 
     onChange: function (value) { 
      //alert('change occurred'); 
     } 
    }, "rangeSlider"); 

你可以在這裏找到更多的細節。

http://jsfiddle.net/g78Uk/21/