0

I feel like this is a very dumb question but please excuse me if there is an obvious answer. I have just recently seriously dug into JQuery (loving it by the way). Anyways in the code below you can see I have the color to animate to white and green in 0 milliseconds... well you would think that would be instant right? That's at least what I would think but it still looks like it's animating slowly on the webpage, so what's up, how can I make it instant?

$('li')
  .mouseenter(function() {
    $(this).animate({backgroundColor: "#fff"}, 500);
    $(this).animate({color: "#669934"}, 0);
  })
  .mouseleave(function() {
    $(this).animate({backgroundColor:"rgba(0,0,0,0)"}, 500);
    $(this).animate({color: "#fff"}, 0);
  });
2
Contributors
3
Replies
12
Views
2 Years
Discussion Span
Last Post by Bensirpent07
0

Are you talking about just the font color that you have set to "0"? It's instant for me in Chrome and Firefox.

0

Oh I figured it out, I just had to put the font-color change animation before the background color change... I guess that should have been a little obvious, now be prepared I'm about to ask another bad question probably... how could I make it to where it runs both the background color changer and the font color changer at once?

0

Well actually after looking at it a little more with the font color changing instantly and then instantly running the background color changer afterwards it basically is at the same time... so this question is answered :D

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.