2 Years
Discussion Span
Last Post by mintu_2

If you have 5 items and then loop 0 to 5. That's one too many.

Your choice of -1 or change i<= to i< whichever you can wrap your head around. The right way would be to drop the = sign but the key item is for you to think of the array count is one number and arrays start at zero so think about that.

Edited by rproffitt


That's the same code as above. Sorry but you need to think about your for loop harder.

An array of 5 items is indexed from 0 to 4. You have it from 0 to 5 so that's not 5 but 6. Keep thinking, you'll get it soon.


So is this a new issue? Your topic is "i have 5 imges and lightgallery shows 6 images." If you have a new issue, state it in a new thread so we can tackle that.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.