]>
git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/pretty-json/node_modules/jsonminify/report/assets/scripts/vendor/jquery.fittext.js
2a482dbd61370ecbe3b19d383764ce001e8ec389
5 * Copyright 2011, Dave Rupert http://daverupert.com
6 * Released under the WTFPL license
7 * http://sam.zoy.org/wtfpl/
9 * Date: Thu May 05 14:23:00 2011 -0600
14 $.fn
.fitText = function( kompressor
, options
) {
17 var compressor
= kompressor
|| 1,
19 'minFontSize' : Number
.NEGATIVE_INFINITY
,
20 'maxFontSize' : Number
.POSITIVE_INFINITY
23 return this.each(function(){
28 // Resizer() resizes items based on the object width divided by the compressor * 10
29 var resizer = function () {
30 $this.css('font-size', Math
.max(Math
.min($this.width() / (compressor
*10), parseFloat(settings
.maxFontSize
)), parseFloat(settings
.minFontSize
)));
36 // Call on resize. Opera debounces their resize by default.
37 $(window
).on('resize', resizer
);