this
points to the current element:
for (var i = 1; i < 10; i++){
$('.infinite-container' + i).waypoint(function () {
$(this).fadeTo('slowly', 0);
}, {offset: '40%'});
}
If all of your elements share the same class you don't need a loop at all:
$('.infinite-container').waypoint(function () {
$(this).fadeTo('slowly', 0);
}, {offset: '40%'});
Take a look at the example of the jQuery waypoint documentation:
http://imakewebthings.com/jquery-waypoints/examples/dial-controls/
$('.dial li').waypoint( function(direction) {
var $active = $(this);
var property, value;
// ...
});
http://imakewebthings.com/jquery-waypoints/examples/scroll-analytics/
$('.ad-unit').waypoint(function() {
recordAdEvent($(this).data('analyticsid'));
}