More color animations at the same time on the same element
I've downloaded the folowing plugin:
http://plugins.jquery.com/project/color
And it worked ! But now I want to now if I cand do more color animations on one element.
I have an example, when an <li> is hovered, it chages its background color, and at the same time, I want it to change the color (text color):
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
- <head>
-
- <title>jQuery testing</title>
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
- <script type="text/javascript" src="http://netcustoms.webs.com/colors_jquery.js"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- $('ul.menu li').animate({backgroundColor : 'black'});
- $('ul.menu li').hover(function() {
- $(this).stop().animate({backgroundColor : 'red'}, 400);
- }, function() {
- $(this).stop().animate({backgroundColor : 'black'}, 400);
- });
- });
- </script>
- <style type="text/css">
- body {
- color: #666666;
- font-family: Verdana;
- font-size: 11px;
- background: #EAEAEA;
- }
- a {
- text-decoration: none;
- }
- ul.menu {
- list-style: none outside none;
- padding: 0px;
- margin: 0px;
- }
- ul.menu a {
- color: white;
- padding: 10px 16px;
- display: block;
- }
- </style>
- </head>
- <body>
- <ul class="menu">
- <li><a href="#">Link</a></li>
- <li><a href="#">Link 2</a></li>
- <li><a href="#">Link 3</a></li>
- </ul>
- </body>
- </html>