felixhagspiel / jsOnlyLightbox

Responsive Lightbox in plain JS. No need for jQuery.
MIT License
157 stars 49 forks source link

make thumbnails accessible so that images can be added dynamically #4

Closed mohan43u closed 9 years ago

mohan43u commented 9 years ago

this patch will make thumbnails (which is used for grouping images) accessible so whenever a image element loaded dynamically, one can push that image element to this array.

like this,

var dynamicpic = createDynamicImageElementFromUrl('//somewhere.ext/some/image'); lightbox.thumbnails.push(dynamicpic); dynamicpic.addEventListener('click', function(e) { lightbox.open(this); });

felixhagspiel commented 9 years ago

@mohan43u sorry for late response, I did not get notifications for pull requests. Unfortunately I cannot auto merge anymore, but I included the thumbnails attribute in the development branch and will merge it into master in the next few days.