「invoke」を「observe」と「click」を引数として使用して、「invoke」が現在反復している項目にアクセスする方法はありますか?
私はこれをやっています:
1.
$$('.item').invoke('observe', 'click', function(event) {
// I want to access the .item that was clicked in here
});
できます
2.
$$('.item').first().observe('click', function(node) {
// I can access the .item right here with 'node'
})
私もできる
3.
$$(".item").each(function(node) {
node.observe('click', function(event) {
// use 'node' here for the .item clicked
});
しかし、クリックされた要素にアクセスしながら、#1(省略形)を行う方法があるかどうかを知りたいです。
それを行う方法はありますか?