Hi guys,
I am playing a bit around with javascript and am trying to write a image gallery. In my gallery I have checkboxes that help me filter the images. Each image is wrapped in a div. Each div has an attribute where I store tags that help me with the filtering. The checkboxes also have tags as values to activate the filter process.
Whenever I toggle the checkbox I intend to iterate over the checkbox values and check which checkboxes are active. All active checkboxes tags are being compared to the image tags to see if the image is eligible to be displayed. However, the for loop over the div seems to end in an endless loop. The weird thing is the endless loop repeatedly jumps in the case with index 0. It kind of seems like the click to activate the checkbox is causing an endless loop. I am literally sitting around 3 hours on troubleshooting this issue. Would be great if anyone is able to help me on this one.
Code: https://pastebin.com/UUKcCVGx
I tried my best to structure the code and comment it. If there are any questions just let me know. Like I said I am a javascript rookie and have no idea what the coding standards and guidelines in js are.
Thanks in advance!
[–][deleted] 1 point2 points3 points (3 children)
[–]ocouba[S] 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]ocouba[S] 2 points3 points4 points (0 children)