From 4e626b4b5407956edf8d169bf3be5b568b169a5a Mon Sep 17 00:00:00 2001 From: Tom Doan Date: Fri, 14 Mar 2014 17:33:16 +0800 Subject: [PATCH] v1.0.2 - Optimized performance --- jquery.scalem.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/jquery.scalem.js b/jquery.scalem.js index e739655..7185cde 100644 --- a/jquery.scalem.js +++ b/jquery.scalem.js @@ -1,5 +1,5 @@ /*! -* Scalem v1.0.1 - A responsive text jQuery plugin +* Scalem v1.0.2 - A responsive text jQuery plugin * Copyright 2014, Tom Doan (http://www.tohodo.com/) * * Scalem by Tom Doan is licensed under the MIT License. @@ -20,7 +20,7 @@ $o2 = $o.clone().css({ 'width': 'auto', 'display': 'none', - 'white-space':'nowrap' + 'white-space': 'nowrap' }), /* If data attribute exists, use that instead */ $ref = o.getAttribute('data-scale-reference') ? $(o.getAttribute('data-scale-reference')) : $(oSettings.reference), @@ -42,8 +42,10 @@ return; } // Scale the text! (6px is minimum font size to get accurate ratio) - for (var i=Math.round((6/$o2.css('font-size', '6px').width())*nTargetWidth); i nRatio) { $o.css('font-size', (i - 1) + 'px'); break;