Closed kalmerrautam closed 6 years ago
It's because of const html = target.outerHTML
. This will place the whole div.lightbox
in the lightbox instead of just the video. You can change it to const html = target.innerHTML
.
I highly recommend to try the new version and demos of basicLightbox. Using DOM elements is now a lot easier. No getTarget
helper required. Just pass the Node to the lightbox.
When Youtube/Vimeo video Iframe is placed in inline html: https://jsfiddle.net/kalmerrautam/hmynv9qe/1/ video inside BasicLightbox doesn't scale while narrowing browser window.
Somehow it works perfectly while video ise placed in init script: https://jsfiddle.net/kalmerrautam/138td6mk/