Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Moving embedded youtube iframe in dom with jquery causes fullscreen to not work in Windows8 IE10

I am trying to move the contents of one div and append it to another div. The div that I am moving includes a embedded youtube iframe. When I try clicking on the full screen button after the div has been moved, the video resets instead of continuing playback in full screen. The same issue happens if I move the iframe itself to another location.

Here's an example:

$(iframes).each(function() {
    $('.tab_content').append($(this));
});

After moving the embedded iframes, in Windows 8 IE10, I can't view the video in full screen.

Reloading the iframe also doesn't seem to be fixing the bug:

$('iframe').each(function() {
    var src = $(this).attr('src');
    $(this).attr('src', '');
    $(this).attr('src', src);
});
like image 545
Anthony Martin Avatar asked Aug 26 '13 21:08

Anthony Martin


1 Answers

you can use this method.

$('iframe').each(function() {
    $('.tab_content').append($(this).prop('outerHTML'));
    $(this).remove();
});

Cheers!

like image 143
jCaMaX Avatar answered Sep 20 '22 05:09

jCaMaX