electerious / basicLightbox

The lightest lightbox ever made.

Home Page:https://basiclightbox.electerious.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Iframe responsiveness

kalmerrautam opened this issue · comments

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/

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.