jQuery Plugin For Responsive Font Size with Text Truncation - QuickFit

jQuery Plugin For Responsive Font Size with Text Truncation - QuickFit
File Size: 6.39 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Just another jQuery responsive text plugin which dynamically adjusts the font size to make your single line text fit its parent container, with or without text truncation.

Basic usage:

1. Just add jQuery library and the jQuery QuickFit plugin to the webpage and we're ready to go.

<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="jquery.quickfit.js"></script>

2. Call the function on the text wrapper and done.

$('#container').quickfit({ // options });

3. Possible options to customize the text resize plugin.

$('#container').quickfit({ 

  // minimum font size
  min: 8,

  // maximum font size
  max: 12,

  // add a padding to the calculation
  tolerance: 0.02,

  // enable text truncation if overflow
  truncate: false,

  // a size which the text should be fitted to
  width: null
  
});

This awesome jQuery plugin is developed by chunksnbits. For more Advanced Usages, please check the demo page or visit the official website.