开发者

CSS and animate() in jquery

开发者 https://www.devze.com 2023-02-05 11:36 出处:网络
I\'m trying to make navigation with some effects but my jquery code dosen\'t works like I expected. Actually I want to pass this css statement background: #ccc url(\'image.jpg\') no-repeat; to animate

I'm trying to make navigation with some effects but my jquery code dosen't works like I expected. Actually I want to pass this css statement background: #ccc url('image.jpg') no-repeat; to animate function.

How to do that ?

<ul>
     <li><a href="#"></a></li>
     <li><a href="#"></a></li>
    </ul>

        $('ul li').hover(function() {    

            $(this).animate({
               'background' : '#ccc' 
            }, 'fast开发者_JAVA技巧');
        }
        });


jQuery cannot animate colors natively. You need a plugin like the jQueryUI.

http://jqueryui.com/demos/animate/


You need jQuery color plugin to animate colors.

Another option to go for is jQueryUI

0

精彩评论

暂无评论...
验证码 换一张
取 消