davatron5000 / FitText.js

A jQuery plugin for inflating web type
http://fittextjs.com
6.76k stars 1.39k forks source link

[Improving performance] Using the style.fontSize and style.width #83

Closed saintclair closed 11 years ago

saintclair commented 11 years ago

Through the use of native features js good performance is proven;

Compare performance (style):

fontSize: http://jsperf.com/resizers **(new) > width: http://jsperf.com/jquery-css-vs-width-vs-native-width/2

davatron5000 commented 11 years ago

Soo... this doesn't work at all. :disappointed: $this[0].style.width returns an empty string. and parseInt($this[0].style.width) returns NaN.

You really need to test the code you're commiting against example.html instead of making assumptions.

saintclair commented 11 years ago

Sorry if this was the scope would have to create a variable, then returned with $ this.width () will create the pull request now

davatron5000 commented 11 years ago

:rage2: Still doesn't work.

saintclair commented 11 years ago

just a few more minutes I'm evaluating return in a few moments

saintclair commented 11 years ago

new version, sorry rework, pull request created, performed tests on the console is not informed any more error