Skip to content

Instantly share code, notes, and snippets.

Sujesh Kumar U V sujeshkumaruv

View GitHub Profile
View jquery.textfill.js
(function($) {
$.fn.textfill = function(maxFontSize) {
maxFontSize = parseInt(maxFontSize, 10);
return this.each(function(){
var ourText = $("span", this),
parent = ourText.parent(),
maxHeight = parent.height(),
maxWidth = parent.width(),
fontSize = parseInt(ourText.css("fontSize"), 10),
multiplier = maxWidth/ourText.width(),
You can’t perform that action at this time.