Domanda

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

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top