black screen when removing an embedded youtube video by javascript in IE8 black screen when removing an embedded youtube video by javascript in IE8 jquery jquery

black screen when removing an embedded youtube video by javascript in IE8


I solved that by hiding the iFrame before removing it while removing the parent popup.
So I say $('iframe').hide(); then $('myContainerPopup').remove();

I faced this problem just on IE8 and youtube videos, didn't test on IE7 but on all other browsers things were working fine.


I use this code:

$(document).ready(function() {$('.popup-gallery').magnificPopup({    callbacks: {        open: function() {$('iframe').hide();},        close: function() {$('iframe').show();}    }   });

});