PeeHaa
PeeHaa

Reputation: 72652

Simple jQuery animate question

I'm must be doing something stupid, because I can't make this simple animate work :P

$(document).ready(function() {
    $('li').hover(function() {
        $(this).stop().animate({
            backgroundColor: '#ff3300'
        }, 500);
    }, function() {
        $(this).stop().animate({
            backgroundColor: '#000000'
        }, 500);        
    });
});

http://jsfiddle.net/GY3UG/1/

It doesn't do the animation.

Upvotes: 0

Views: 86

Answers (2)

daryl
daryl

Reputation: 15197

I would choose jQuery Color personally as it's 4kb.

Upvotes: 0

manji
manji

Reputation: 47978

You have to reference jQuery UI script file too. (In jsFiddle check the jQuery UI 1.8.7 box). That's where the animate function is.

( http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.js )

Upvotes: 6

Related Questions