爲什麼RaphaelJS(2.0.0)中的這個事件處理程序直接運行,而不是當您點擊它時?爲什麼RaphaelJS中的這個事件處理程序直接運行?
function enlarge (shape) {
shape.animate({'transform' : 's2'}, 200);
}
jQuery(function() {
var paper = Raphael("canvas", 1000, 1000);
var button = paper.circle(300, 50, 20);
button.attr({'fill':'black'});
var circle = paper.circle(50, 50, 20);
circle.attr({'fill':'red'});
button.mousedown(enlarge(circle));
});
據透露,如果更換'的jQuery(函數(){'和'的jQuery(函數($){'你可以使用'$'那個函數內不得不一直編寫'jQuery'(即使在你的情況下,因爲你沒有使用它而沒有關係) – ThiefMaster