I have a YouTube video I want to put on my web page.
I want to scale the video to fit to a percent of the users browser but also to keep the aspect ratio.
I hav
Quite easy with some javascript.
jQuery(function() { function setAspectRatio() { jQuery('iframe').each(function() { jQuery(this).css('height', jQuery(this).width() * 9/16); }); } setAspectRatio(); jQuery(window).resize(setAspectRatio); });