Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 896 Bytes

README.md

File metadata and controls

35 lines (27 loc) · 896 Bytes

Keep Ratio

Build Status

A jQuery plugin for keeping the aspect ratio

Example usage: http://loonkwil.github.io/jquery.keep-ratio/

Install

Requirements Bower

bower install git://github.com/loonkwil/jquery.keep-ratio.git --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/jquery.js"></script>
  <script src="bower_components/request-animation-frame/rAF.js"></script>
  <script src="bower_components/jquery.keep-ratio/src/jquery.keep-ratio.js"></script>
  <script type="text/javascript">
    $(function() {
      $('div').keepRatio({ ratio: 4/3, calculate: 'width' });
    });
  </script>
</body>