我有这段代码,我的目标是获取数组对象。
萤火虫中没有错误,但没有显示值(始终undefined
)。正确的方法是什么?
var sizes = ["a","b","c","d","e","f"];
var s = new dijit.form.HorizontalSlider({
value:1,
name:"i"+[i],
onChange:function(sizes, val){
dojo.byId('value'+[i]).value = sizes[val];
},
minimum:1,
maximum:sizes.length -1,
discreteValues:sizes.length,
},node);
在jQuery中看起来像:
var sizes = ["0","2","4","6","8","10","12","14","16","18","16W","18W","20W"];
$("#slider-size .slider").slider({
min: 0,
max: sizes.length - 1,
step: 1,
slide: function(event, ui) {
$(".rsize").text(sizes[ui.value]);
}
});
来自here
最佳答案
minimum:0,
是问题。谢谢
关于javascript - 获取数组的值,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7770948/