Javascript library to help creating high quality justified galleries of images. Used by thousands of websites as well as the photography community 500px.
I have a button below my gallery that lets the user load more images if not enough images were loaded to require the scrollbar (scrolling to the end would otherwise auto load more). I was testing that this button works, by first letting the page load some initial images, and then zooming out the page until I can see the button without scrolling, then clicking on it to load more images.
I subsequently discovered a bug where, after the loading of images resulting from clicking the button, the images add and display fine (using the norewind option), but the jg.complete event will sometimes fire, other times not. It is a 50/50 chance whether the event will be fired or not. To give you an example, I repeated the above actions multiple times, immediately after each other and refreshing the page in between each one, with zero changes made to either the code or how the page was used. I got the following relating to whether the jg.complete event was fired after clicking the button: not fired, fired, not fired, not fired, not fired, fired, fired, not fired.
I was able to stop the bug happening by removing the first return statement in the analyzeImages function, but I do not know the codebase well so am not expecting that to have no side effects.
Hopefully this info, and the fix that I have found to work will enable you to pinpoint the real cause and fix it. The furthest I got with debugging was establishing that analyzeImages(false) is being called but it never reaches the line responsible for triggering the event.
I have a button below my gallery that lets the user load more images if not enough images were loaded to require the scrollbar (scrolling to the end would otherwise auto load more). I was testing that this button works, by first letting the page load some initial images, and then zooming out the page until I can see the button without scrolling, then clicking on it to load more images.
I subsequently discovered a bug where, after the loading of images resulting from clicking the button, the images add and display fine (using the
norewind
option), but thejg.complete
event will sometimes fire, other times not. It is a 50/50 chance whether the event will be fired or not. To give you an example, I repeated the above actions multiple times, immediately after each other and refreshing the page in between each one, with zero changes made to either the code or how the page was used. I got the following relating to whether the jg.complete event was fired after clicking the button: not fired, fired, not fired, not fired, not fired, fired, fired, not fired.I was able to stop the bug happening by removing the first
return
statement in theanalyzeImages
function, but I do not know the codebase well so am not expecting that to have no side effects.Hopefully this info, and the fix that I have found to work will enable you to pinpoint the real cause and fix it. The furthest I got with debugging was establishing that
analyzeImages(false)
is being called but it never reaches the line responsible for triggering the event.