Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

animate text-align with jquery

Tags:

jquery

I'm new to jquery and have developed a simple resizing navigation menu using

$(this).stop().animate({width:170},"slow");

for the on hover effect.

My question is, how would i be able to add an animate effect to changing the text alignment.

I understand that this changes it:

$('.myElementClass').css('text-align','center');

but it looks ugly, and:

$(this).stop().animate({'text-align: left'}, "slow");

does'nt work at all.

like image 643
slexAtrukov Avatar asked Aug 29 '26 03:08

slexAtrukov


1 Answers

You cannot use textAlign as it is not numeric and cannot be eased in between states.

like image 187
BoringCode Avatar answered Aug 30 '26 17:08

BoringCode



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!