Skip to content

Commit

Permalink
Fix for bug #70 (multiple galleries on one page not working)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfg92 committed Feb 25, 2024
1 parent 90ae0f2 commit 24b5073
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions layouts/shortcodes/gallery.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,11 @@
</div>

<script>
if (!window.jQuery) {
throw new Error("jQuery is not loaded, hugo-shortcode-gallery wont work without it!");
if (!("HSCGjQuery" in window)) {
if (!window.jQuery) {
throw new Error("jQuery is not loaded, hugo-shortcode-gallery wont work without it!");
}
window.HSCGjQuery = window.jQuery.noConflict(true);
}

// Isolate all our variables from other scripts.
Expand Down Expand Up @@ -413,5 +416,5 @@
// End of our variable-isolating and self-executing anonymous function.
// We call it with the one version of jQuery that was used to load our plugins.
// See: http://blog.nemikor.com/2009/10/03/using-multiple-versions-of-jquery/
})($.noConflict(true))
})(window.HSCGjQuery)
</script>

0 comments on commit 24b5073

Please sign in to comment.