In a for
loop, the i
is my loop counter.
console.log($(f_images[i].DOM));
$(f_images[i].DOM).hover(function() {
console.log($(f_images[i].DOM));
}, function() {});
Console showed me:
[object Object]
"Uncaught TypeError: Cannot read property 'DOM' of undefined".
Same thing happened if I replace $(f_images[i].DOM)
with whatever related to f_images
.
Why can't I access the object array itself in the hover function?