Open zraly opened 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?
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.
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.
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'));
});
By setting data-fittext-kompressor attribute. For example, data-fittext-kompressor="0.5" sets compressor value for the element to 0.5