2013-06-21 240 views

回答

0

你在找這個值$( '#腐')。VAL()

while (i < 1000) { 
     setTimeout(function() { rotate() }, 1000); 
     alert($('#rot').val()); 
     i += 1; 
    } 
+0

不,我試圖設置'#rot''的值到圖層的當前旋轉,沒有得到它。 –

0

animateLayer()animateLayerGroup()方法支持相同的備用語法jQuery的animate()方法,它允許step回調:

// Cache canvas element 
var $canvas = $("canvas"); 

// Draw and animate 
$canvas.drawArc({ 
    layer: true, 
    name: 'arcy', 
    fillStyle: "#000", 
    x: 100, y: 100, 
    radius: 50, 
    start: 135, end: 45 
}); 
$canvas.animateLayer('arcy', { 
    rotate: 360 
}, { 
    // Use the step callback to run a function on every frame 
    step: function(now, fx, layer) { 
    console.log(layer.rotate); 
    } 
}); 
相關問題