A jQuery plugin for keeping the aspect ratio

https://github.com/loonkwil/jquery.keep-ratio
$('#first').keepRatio({ ratio: 16/9, calculate: 'height' });
$('#second').keepRatio({ ratio: 4/3, calculate: 'width' });