Frage

I want to add some long text to span and make it's height grow smoothly.

 $('span').text('Long long Long long Long long Long long Long long Long long Long long Long long Text').animate('height', 'slow')

Doesn't work

JS Fiddle

War es hilfreich?

Lösung

You have to specify how large it is, and how large you want it to grow. Check this one out:

http://jsfiddle.net/6hvZT/273/

Here's where you specify the size it grows to:

$('.element').text(text).animate({'height':'150px'}, 'slow');

Also, specify the height of the element in its CSS.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top