<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="http://cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
    <style type="text/css">
        .test {
            height: 100px;
            width: 100px;
            background: green;
            display: none;
            float: left;
            margin-right: 10px;
        }
    </style>
</head>
<body>
    <div class="test"></div>
    <div class="test"></div>
    <div class="test"></div>
    <div class="test"></div>
    <button class="show">show</button>
    <button class="hide">hide</button>
    <script type="text/javascript">
        $(function(){
            $('.show').on('click',function(){
                $('.test').first().show('fast',function showBox(){
                    $(this).next().show('fast',showBox);
                })
            })
            $('.hide').on('click',function(){
                $('.test').last().hide('fast',function hideBox(){
                    $(this).prev().hide('fast',hideBox);
                })
            })
        })
    </script>
</body>
</html>

 

相关文章:

  • 2021-06-18
  • 2021-12-21
  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
  • 2021-12-30
猜你喜欢
  • 2021-07-30
  • 2021-07-11
  • 2021-08-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案