davatron5000 / FitText.js

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

Force text to one line #111

Closed elmerland closed 10 years ago

elmerland commented 10 years ago

Hi, just started using FitText. I'm trying to make my title responsive and at the same time make it occupy only one line of text at all times. I can't seem to figure out why FitText splits my header into two lines. Below is a sample of my code. I don't know if this a feature of the plugin or if I'm supposed to explicitly tell the title to be in one line.

HTML:

<header>
  <h1 id="my-title">My Somewhat Long Title</h1>
</header>

JS:

$(document).ready(function() {
  $("#my-title").fittext();
});
elmerland commented 10 years ago

After playing with some of the examples I realized that the compressor actually changes the size of the text. Therefore by changing the compressor you can get to the desired size. For some reason I thought that the compressor dealt with how often the text size was changed as the window resized. Anyway, thanks for a great plugin!

vlrprbttst commented 7 years ago

i'm having the same "problem"..

Oh, and don't you dare let us catch you using FitText on paragraph text. This is for gigantic display text only!

but still, that would a good feature.

breadadams commented 7 years ago

Yeah it'd be very handy. For example, in the case of a dynamic label (entered by a user) that could be any number of characters.

Great plugin nonetheless 😄

davatron5000 commented 7 years ago

I recommend checking out BigText or Fitter Happier Text for single line text.