我想將使用JavaScript編寫的jQuery函數轉換爲Coffeescript,該函數將兩個函數作爲參數。我是Coffeescript的新手,我有點卡在這裏。原始功能類似於:如何將帶有兩個函數參數的jQuery函數轉換爲Coffeescript
$('#target').toggle(function() {
alert('First handler for .toggle() called.');
}, function() {
alert('Second handler for .toggle() called.');
});
它在Coffeescript中的外觀如何?
http://aaronrussell.co.uk/articles/using -coffeescript-with-jquery/ –