1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| appendImages(t) { const i = this; e.jQuery && t instanceof e.jQuery && (t = t.get()), t && t.length && (t.forEach((t=>{ if (t && !t.fjGalleryImage && t.querySelector) { const e = t.querySelector(i.options.imageSelector); if (e) { t.fjGalleryImage = i; const o = { $item: t, $image: e, width: 0, height: 0, loadSizes() { const t = this; if (e.tagName.toLowerCase() === "img") { t.width = parseFloat(e.width) || !1; t.height = parseFloat(e.height) || !1; } else if (e.tagName.toLowerCase() === "video") { e.addEventListener('loadedmetadata', function() { t.width = e.videoWidth || !1; t.height = e.videoHeight || !1; if (t.width && t.height) { i.resize(); } }); } c(e, (e=>{ t.width === e.width && t.height === e.height || (t.width = e.width, t.height = e.height, i.resize()) } )) } }; o.loadSizes(), i.images.push(o) } } } )), i.options.onAppendImages && i.options.onAppendImages.call(i, [t]), i.justify()) }
|