Problema prototype - evento listener
AUTOR PREGUNTA #1
Event.observe(window, 'load', function() {
for(i = 1; i <= $$('ul#review_list li').length; i++) {
$('cover_' + i).observe('click', function(event) {
alert(i);
});
} });
¿Alguna sugerencia para qué este código me funcione?
-
¿Tienes la misma pregunta? Yo también
Esto también te interesa!
PREGUNTAS SIMILARES
#2
Event.observe(window, 'load', function() {
for(var i = 1; i <= $$('ul#review_list li').length; i++) {
$('cover_' + i).observe('click', function(event) { alert(i); }); } });
#3
Event.observe(window, 'load', function() {
for(i = 1; i <= $$('ul#review_list li').length; i++) {
(function (i) {
$('cover_' + i).observe('click', function(event) {
alert(i);
}); })(i);
} });