Adam Bowen f234b4ae0e Throw Errors instead of logging to console
Not all browsers have `console` defined. Also, both of these cases
where you logged to the console were cases where the user was
potentially using the library incorrectly. Throwing errors will
alert the user immediately that they are doing something wrong, and
will provide them with the means to fix the problem.
2012-09-21 15:26:17 -05:00
2012-09-17 23:45:33 +02:00
2012-09-18 00:07:23 +02:00

Responsive-Measure

A jQuery plugin for generating a responsive ideal measure.

Getting Started

Download the javascript

In your web page:

<script src="jquery.js"></script>
<script src="jquery.rm.js"></script>
<script type="text/javascript">
	
$('section').responsiveMeasure({
	// Variables you can pass in:
	idealLineLength: (defaults to 66),
	minimumFontSize: (defaults to 16),
	maximumFontSize: (defaults to 300),
	ratio: (defaults to 4/3)
});

  </script>

Extended feature(s)

This plugin includes a feature for generating a typographic scale that you can apply automagically on resize.

$(document).on('responsiveMeasureUpdated', function(e, data) {
	$('.giga').css('fontSize', data.fontRatios[9] + 'px');
	$('h1').css('fontSize', data.fontRatios[8] + 'px');
	$('h2').css('fontSize', data.fontRatios[7] + 'px');
	$('h3').css('fontSize', data.fontRatios[6] + 'px');
	$('p').css('fontSize', data.fontRatios[5] + 'px');
	$('.sm').css('fontSize', data.fontRatios[4] + 'px');
});

Documentation

(Coming soon)

Examples

Check out the examples directory for samples of the plugin in use.

Release History

(Nothing yet)

License

Copyright (c) 2012 Josh Brewer
Licensed under the MIT, GPL licenses.

Description
No description provided
Readme 641 KiB
Languages
JavaScript 100%