Sha256: 2572baf967e9e8eff40f2c6af10c016e6154d12b52c13a6ab480d7dcad41e177
Contents?: true
Size: 734 Bytes
Versions: 83
Compression:
Stored size: 734 Bytes
Contents
$(function() { var $allVideos = $("iframe[src^='http://player.vimeo.com'], iframe[src^='http://www.youtube.com'], object, embed"), $fluidEl = $("figure"); $allVideos.each(function() { $(this) // jQuery .data does not work on object/embed elements .attr('data-aspectRatio', this.height / this.width) .removeAttr('height') .removeAttr('width'); }); $(window).resize(function() { var newWidth = $fluidEl.width(); $allVideos.each(function() { var $el = $(this); $el .width(newWidth) .height(newWidth * $el.attr('data-aspectRatio')); }); }).resize(); });
Version data entries
83 entries across 83 versions & 2 rubygems