I play with animated text on click.
I have buttons with various classes that define size:
<div class="button-1">Click Me!</div> <div class="button-2">Click Me!</div> <div class="button-3">Click Me!</div> .button-1 {font-size: 10px;} .button-2 {font-size: 20px;} .button-3 {font-size: 30px;}
Then, when one is clicked, it animates to a larger size.
$('.button-1,.button-2,.button-3').click(function(){ $(this).animate({fontSize: "40px" }, 1000 );
My question is: I only want to have one big one at a time, and all the brothers and sisters come back to their original size. I see that the animate function works by adding an inline style to the text, is there a way I can just remove all the inline styles added to the pressed siblings buttons?
source share