Skip to content

Commit

Permalink
Small update for accuracy.
Browse files Browse the repository at this point in the history
  • Loading branch information
heygrady committed Mar 23, 2013
1 parent 1b1058b commit efbfeb7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion readme.md
Expand Up @@ -31,7 +31,7 @@ Angle.toTurn('1turn'); //-> 1
```

## Length
Used for converting between various length units. Absolute units -- such as inches, points and centimeters -- are relative to the Screen DPI which is usually 96. Not all units are supported in every browser, in those cases 0 is returned. In all cases this library uses the browsers own CSS calculations (by setting values with the style property). There's a detailed description of [CSS length units on the MDN](https://developer.mozilla.org/en/CSS/length). The length library is around 1200 characters when minified.
Used for converting between various length units. Absolute units -- such as inches, points and centimeters -- are relative to the Screen DPI which is usually 96. Not all units are supported in every browser, in those cases 0 is returned. In all cases this library uses the browsers own CSS calculations (by setting values with the style property). There's a detailed description of [CSS length units on the MDN](https://developer.mozilla.org/en/CSS/length). The length library is around 1100 characters when minified.

```javascript
// Absolute Units
Expand Down
7 changes: 4 additions & 3 deletions test.html
Expand Up @@ -41,11 +41,12 @@
<strong id="strong">hello</strong>
<em id="em">hello</em>

<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<!-- Grab Google CDN's jQuery, with a protocol relative URL -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

<!-- Unit.js -->
<script src="Length.js"></script>
<script src="Length.min.js"></script>

<!-- test -->
<script>
var units = ['10%', '96px', '25.4mm', '2.54cm', '1in', '72pt', '6pc', '25.4mozmm', '6rem', '10vh', '10vw', '10vm', '6em', '13.4ex', '12ch'],
Expand Down

0 comments on commit efbfeb7

Please sign in to comment.