davatron5000 / FitText.js

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

Possibility to set compressor ratios individually for every element #94

Open zraly opened 10 years ago

zraly commented 10 years ago

By setting data-fittext-kompressor attribute. For example, data-fittext-kompressor="0.5" sets compressor value for the element to 0.5

davatron5000 commented 10 years ago

I really like this! I think it maybe makes sense to only create one compressor variable inside the return $.each() rather than having two very similar (named) variables in memory. Thoughts?

zraly commented 10 years ago

I am not so good in JS to write it in this hard-skill way, so please improve it as you think. But I am very happy I could help.

gregaltuna commented 10 years ago

I don't know, really. I just know it's awesome being able to set min/max and compression for each when you're using the plugin outside of Drupal. I was just thinking it's be nice to have those components built into the UI instead of simply a box to list selectors. That's just my 2 cents ;-)

On Jan 7, 2014, at 7:50 PM, Dave Rupert notifications@github.com wrote:

I really like this! I think it maybe makes sense to only create one compressor variable inside the return $.each() rather than having two very similar (named) variables in memory. Thoughts?

— Reply to this email directly or view it on GitHub.

kenhowardpdx commented 10 years ago

I'm doing something outside of FitText that may be helpful to someone...

    $('.fittext, .fit-text, h1 span, h2 span, h3 span, h4 span, h5 span, h6 span').each(function() {
        $(this).fitText($(this).data('compress'));
    });