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

allow flexible text length

Open ericdum opened this issue 10 years ago • 4 comments

no matter what the text is, do fitText(), it's will fit to 100% width automatticly

ericdum avatar Aug 26 '13 04:08 ericdum

Can you better describe the problem you're trying to fix? Also, we now require educed test cases. It looks like you're just injecting a bunch of CSS that may or may not be necessary.

davatron5000 avatar Aug 26 '13 16:08 davatron5000

Please take a look the example.html.

I just added a longer text:

<h1 id="fittext4">Squeeze with FitText For Long String</h1>

And execute following code:

$("#fittext4").fitText();

Before this version, the text will break the line.

This version will automatically fit the width.

Just put it on the browser and check it out.

ericdum avatar Aug 26 '13 16:08 ericdum

:+1: I was looking for this. Thanks

dominikwilkowski avatar Nov 26 '13 06:11 dominikwilkowski

FitText was designed to work with multiple lines of text. So I'm not really sure that this fits that use case. Maybe putting this functionality behind a noBreak: true option is something to consider.

davatron5000 avatar Nov 26 '13 15:11 davatron5000