Created
July 28, 2012 21:33
-
-
Save donabrams/3194893 to your computer and use it in GitHub Desktop.
Change em-based size by adjusting font-size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # reflexive layout based on em's | |
| (($el, scale) -> | |
| win = $(window) | |
| # simplified version of fittext.js | |
| resize = -> | |
| $el.css 'font-size', win.width()/scale | |
| resize() | |
| win.on 'resize', resize | |
| ) $("body"), 80.0 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Zoom doesn't work in chrome with this script though. Not sure why not.