Jquery悬停不在html中工作

Ken*_*ain -1 html javascript css jquery

这是我的html页面:

 <!DOCTYPE html>
    <html>
     <head>
    <style>
      .navigation ul li {
          float: left;
          list-style: none;
          padding: 10px;
          margin-top: 10px;
      }
          .navigation ul li a {
             display: block;
             text-decoration: none;
             font-weight: bold;
          }         
    </style>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">  </script>
    <script>
     $(document).ready(function(){
       $(".navigation ul li a").hover(function(){
          $(this).animate({ color: 'blue'}, "slow");
       }, function() {
          $(this).animate({ color: 'red'}, "slow");
       });
         });
    </script>
    </head>
    <body>
        <div class="navigation">
       <ul>
            <li><a href="#">Specials</a></li>
            <li><a href="#">Fruits &amp; Veg</a></li>
            <li><a href="#">Food Products</a></li>
            <li><a href="#">Locate store</a></li>
            <li><a href="#">Fan Club</a></li>
        </ul>
    </div>
    </body>
    </html>
Run Code Online (Sandbox Code Playgroud)

我想在动画中悬停颜色变化,但它不起作用.同样,在这里,它的工作原理.我不知道为什么?请帮我

Poi*_*nty 5

您正在导入jQuery,但您没有导入jQuery UI.你是在小提琴中这样做的,而不是你在这里发布的代码.

动画颜色需要jQueryUI.