iframes only load after being clicked
This commit is contained in:
parent
eb25744087
commit
c2548be860
1 changed files with 11 additions and 0 deletions
11
js/index.js
11
js/index.js
|
@ -32,3 +32,14 @@ if (btn) btn.addEventListener('click', fullscreen)
|
|||
$(document).ready(function(){
|
||||
$('.carousel.carousel-slider').carousel({full_width: true});
|
||||
});
|
||||
|
||||
$('iframe').each(function() {
|
||||
this.tmp = this.src;
|
||||
this.src = '';
|
||||
$(this).wrap('<div class="iframe_block">')
|
||||
})
|
||||
.parent('.iframe_block')
|
||||
.click(function() {
|
||||
let frame = $(this).children("iframe")[0]
|
||||
frame.src = frame.tmp
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue