diff options
author | Ben Harris <ben@tilde.team> | 2020-03-05 02:12:36 -0500 |
---|---|---|
committer | Ben Harris <ben@tilde.team> | 2020-03-05 02:12:36 -0500 |
commit | 4dfe6d7457eceece2c15eae883a6e00a4f56bc89 (patch) | |
tree | 43ba67dab135d17eb32b9c32914b5bb19020beb7 /js/jquery.fittext.js | |
parent | c5ce29eab8b6964472e3a209161827ad59ba4a1e (diff) |
complete rewrite
Diffstat (limited to 'js/jquery.fittext.js')
-rw-r--r-- | js/jquery.fittext.js | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/js/jquery.fittext.js b/js/jquery.fittext.js deleted file mode 100644 index 080b82e..0000000 --- a/js/jquery.fittext.js +++ /dev/null @@ -1,43 +0,0 @@ -/*global jQuery */ -/*! -* FitText.js 1.1 -* -* Copyright 2011, Dave Rupert http://daverupert.com -* Released under the WTFPL license -* http://sam.zoy.org/wtfpl/ -* -* Date: Thu May 05 14:23:00 2011 -0600 -*/ - -(function( $ ){ - - $.fn.fitText = function( kompressor, options ) { - - // Setup options - var compressor = kompressor || 1, - settings = $.extend({ - 'minFontSize' : Number.NEGATIVE_INFINITY, - 'maxFontSize' : Number.POSITIVE_INFINITY - }, options); - - return this.each(function(){ - - // Store the object - var $this = $(this); - - // Resizer() resizes items based on the object width divided by the compressor * 10 - var resizer = function () { - $this.css('font-size', Math.max(Math.min($this.width() / (compressor*10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize))); - }; - - // Call once to set. - resizer(); - - // Call on resize. Opera debounces their resize by default. - $(window).on('resize.fittext orientationchange.fittext', resizer); - - }); - - }; - -})( jQuery ); |