Skip to content

Commit a28c111

Browse files
bytesandbots3sachinchoolur
authored andcommitted
fix: correct iframe container styles to display external content #1600
1 parent 292bc77 commit a28c111

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/lg-utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ const utils = {
397397
iframeTitle?: string,
398398
): string {
399399
const title = iframeTitle ? 'title="' + iframeTitle + '"' : '';
400-
return `<div class="lg-video-cont lg-has-iframe" style="width:${iframeWidth}; max-width:${iframeMaxWidth}; height: ${iframeHeight}; max-height:${iframeMaxHeight}">
400+
return `<div class="lg-media-cont lg-has-iframe" style="width:${iframeWidth}; max-width:${iframeMaxWidth}; height: ${iframeHeight}; max-height:${iframeMaxHeight}">
401401
<iframe class="lg-object" frameborder="0" ${title} src="${src}" allowfullscreen="true"></iframe>
402402
</div>`;
403403
},
@@ -579,6 +579,7 @@ const utils = {
579579
dynamicEl.alt = alt || title || '';
580580
dynamicElements.push(dynamicEl);
581581
});
582+
console.log(dynamicElements, 'dynamicElements');
582583
return dynamicElements;
583584
},
584585
isMobile(): boolean {

src/scss/lightgallery-core.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,24 @@
258258
}
259259
}
260260
}
261+
262+
.lg-media-cont {
263+
text-align: center;
264+
display: inline-block;
265+
vertical-align: middle;
266+
position: relative;
267+
.lg-object {
268+
width: 100% !important;
269+
height: 100% !important;
270+
}
271+
}
272+
273+
.lg-has-iframe {
274+
.lg-media-cont {
275+
-webkit-overflow-scrolling: touch;
276+
overflow: auto;
277+
}
278+
}
261279
}
262280

263281
.lg-backdrop {

0 commit comments

Comments
 (0)