You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am experiencing an issue with JustifiedGallery. When I attempt to destroy the gallery, it throws the following error:
$('#commandtest').justifiedGallery('destroy');
jquery.justifiedGallery.js:222 Uncaught TypeError: this.resetImgSrc is not a function at HTMLImageElement.<anonymous> (jquery.justifiedGallery.js:222:17) at HTMLImageElement.i (jquery.min.js?ver=3.7.1:2:37034) at HTMLImageElement.dispatch (jquery.min.js?ver=3.7.1:2:40035) at v.handle (jquery.min.js?ver=3.7.1:2:38006)
The text was updated successfully, but these errors were encountered:
saas786
added a commit
to saas786/Justified-Gallery
that referenced
this issue
Jun 3, 2024
Upon troubleshooting, it was found that when an image throws an error, this inside the callback refers to the image element and not the JustifiedGallery instance. This causes a TypeError because this.resetImgSrc is not a function in the context of the image element.
To resolve this, I ensured that this correctly refers to the JustifiedGallery instance by using .bind(this) on the callback function.
I am experiencing an issue with JustifiedGallery. When I attempt to destroy the gallery, it throws the following error:
The text was updated successfully, but these errors were encountered: