Question

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

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top