Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript how can i access these classes Reply To: how can i access these classes

#248903
Shikkediel
Participant

Not sure what your question is but I’d like to offer a tip – you could use to built-in index instead of having all the counter variables:

$(".grid-item").each(function (index) {
    'use strict';
    $(this).attr("data-src", 'contents/photos/width4/4-' + index + '.JPG');
});