jquery----手风琴

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
   *{padding: 0px;margin:0px;}
   li{list-style: none;width:100px;height:100px;border: 1px solid red;float: left}
    </style>
    <script type="text/javascript" src="../jquery-3.1.1.js"></script>
    <script type="text/javascript">
     $(function(){
         $("li").each(function(index,el){
          var inde=index+1;
          $(el).css({background:"url(images/0"+inde+".jpg)"});
         });
     $("li").hover(function(){
         $(this). stop(). animate({width:"600px",height:"400px"},5000). siblings().stop().animate({width:"100px"},5000);
     },function(){
         $("li").stop().animate({width:"200px"},5000);
     });
    });
    </script>
</head>
<body>
    <div>
        <ul>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </div>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/Shh_1758668879/article/details/66489894