FitText.js icon indicating copy to clipboard operation
FitText.js copied to clipboard

Possibility to set compressor ratios individually for every element

Open zraly opened this issue 10 years ago • 4 comments

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

zraly avatar Dec 14 '13 00:12 zraly

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?

davatron5000 avatar Jan 08 '14 01:01 davatron5000

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.

zraly avatar Jan 08 '14 02:01 zraly

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 [email protected] 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.

gregaltuna avatar Jan 08 '14 02:01 gregaltuna

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'));
    });

kenhowardpdx avatar Jul 23 '14 04:07 kenhowardpdx