我试图从我的jQuery滑块捕获值并将其传递给另一个函数。我已经看到了一些这样的例子,但我试图把它传递给一个有多个参数的函数。这是我的滑块代码:
$("#slider_font_size").slider({
min: 1,
max: 3,
step: 1,
slide: function (event, ui) {
TredWareApp.FONT_SIZE = ui.value;
drawTextOnTire();
},
value: TredWareApp.FONT_SIZE,
orientation: 'horizontal'
});
这是我想将其传递给的函数:
function drawTextAlongArc(context, str, centerX, centerY, radius, angle, height) {
var len = str.length, s;
context.save();
context.translate(centerX, centerY);
context.rotate(-1 * angle / 2);
context.rotate(-1 * (angle / len) / 2);
for (var n = 0; n < len; n++) {
context.rotate(angle / len);
context.save();
context.translate(0, -1 * radius);
s = str[n];
//context.fillText(s, 0, 0);
var imageText = document.getElementById(s + "1");
context.drawImage(imageText,0,0, 30, height*15);
context.restore();
}
context.restore();
}
我想传递它作为高度值。我在这里称之为上述功能:
drawTextAlongArc(ctx, $("#tiretext").val(), centerX, centerY, radius, angle, $("#slider_font_size").val());
答案 0 :(得分:0)