Text alignment animation with jquery

I am new to jquery and developed a simple size navigation menu using

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

for hover effect.

My question is how can I add an animation effect to change the alignment of the text.

I understand that this changes it:

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

but it looks ugly and:

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

doesn't work at all.

+3
source share
1 answer

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

+3
source

Source: https://habr.com/ru/post/1766819/


All Articles