Firefox stops youtube video when expanding div

I use jquery to expand the div with youtube embed, but when I click to expand the div size, firefox stops the youtube embed game. Chrome, IE9, etc. Do not stop video playback when expanding the size. I hope someone finds out about the solution.

$(document).ready(function() { $("#wideView").click(function() { $("#youtube-movie").toggleClass("wide"); }); }); 

Greetings

+8
jquery html firefox
source share
1 answer

If you are sure that the code in your OP is the only thing that happens, it is because .wide dynamically changes overflow , which causes the children to be redrawn in firefox. This means that the flash player will reset and stop playing.

Demo here: http://jsfiddle.net/rVbQ6/2/ (do it in firefox and you will see)

The solution is to remove any overflow manipulation.

+1
source share

All Articles