- Код: Выделить всё
jQuery(function() {
var a = $("iframe[src^='http://www.youtube.com']"), c = $(".embed");
a.each(function() {
$(this).data("aspectRatio", this.height / this.width).removeAttr("height").removeAttr("width")
});
$(window).resize(function() {
var b = c.width();
a.each(function() {
var a = $(this);
a.width(b).height(b * a.data("aspectRatio"))
})
}).resize()
});