2
Contributors
8
Replies
36
Views
1 Year
Discussion Span
Last Post by mintu_2
0
for(var i =0;i<=imagesarray.length-1;i++){

Changed line 12?

Edited by pritaeas: Fixed markdown.

0

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

0

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.

0

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.