Configure blueimp-gallery together?

Hello!
There is a script for viewing images in the gallery blueimp-gallery. Here is a script which applies to the gallery with id="gallery".
document.getElementById('gallery').onclick = function (event) {
 event = event || window.event;
 var target = event.target || event.srcElement,
 link = target.src ? target.parentNode : target,
 options = {index: link, event: event},
 links = this.getElementsByTagName('a');
 blueimp.Gallery(links, options);
 };


But if you need some of galleries, independent from each other.
Tried to implement using CLASS , but was not able to run. Maybe that will notice the error.
document.getElementsByClassName('gallery')[0].onclick = function (event) {
 event = event || window.event;
 var target = event.target || event.srcElement,
 link = target.src ? target.parentNode : target,
 options = {index: link, event: event},
 links = this.getElementsByTagName('a');
 blueimp.Gallery(links, options);
 };
March 19th 20 at 08:25
0 answer

Find more questions by tags GalleryImagesJavaScript