質問

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

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top