Keep Ratio
A jQuery plugin for keeping the aspect ratio
Example usage: http://loonkwil.github.io/jquery.keep-ratio/
Install
Requirements Bower
bower install keep-ratio --save
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> </head> <body> <div></div> <script src="bower_components/jquery/dist/jquery.min.js"></script> <!-- For older browsers (http://caniuse.com/#feat=requestanimationframe) --> <script src="bower_components/request-animation-frame/rAF.js"></script> <script src="bower_components/keep-ratio/dist/jquery.keep-ratio.min.js"></script> <script type="text/javascript"> $(function() { $('div').keepRatio({ ratio: 4/3, calculate: 'width' }); }); </script> </body>
How to make your own build
Requirements: NodeJs, Bower, Gulp
bower install
npm install
npm test
gulp dist
or justgulp