Sha256: 2669d0f4b1e8b39840e17ce4e7098342a3c5adc7be73d78b70e25e05d73a64f5
Contents?: true
Size: 1.35 KB
Versions: 9
Compression:
Stored size: 1.35 KB
Contents
// Generated by CoffeeScript 1.4.0 /* * * jQuery ResponsiveText by Gary Hepting - https://github.com/ghepting/responsiveText * * Open source under the BSD License. * * Copyright © 2013 Gary Hepting. All rights reserved. * */ (function() { (function($) { var elems; elems = []; $.fn.responsiveText = function(options) { var settings; settings = { compressor: options.compressor || 10, minSize: options.minSize || Number.NEGATIVE_INFINITY, maxSize: options.maxSize || Number.POSITIVE_INFINITY }; return this.each(function() { var elem; elem = $(this); elem.attr('data-compression', settings.compressor); elem.attr('data-min', settings.minSize); elem.attr('data-max', settings.maxSize); elem.css("font-size", Math.floor(Math.max(Math.min(elem.width() / settings.compressor, parseFloat(settings.maxSize)), parseFloat(settings.minSize)))); return elems.push(elem); }); }; return $(window).on("resize", function() { return $(elems).each(function() { var elem; elem = $(this); return elem.css("font-size", Math.floor(Math.max(Math.min(elem.width() / (elem.attr('data-compression')), parseFloat(elem.attr('data-max'))), parseFloat(elem.attr('data-min'))))); }); }); })(jQuery); }).call(this);
Version data entries
9 entries across 9 versions & 3 rubygems