Вопрос

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