js代码
<script src="js/jquery-1.11.0.min.js" type="text/javascript"></script> <script type="text/javascript"> // Below code only for demo purposes // You can remove the `&.hover,` class from the CSS // if you don't need it $(document).ready(function() { var count = 0; var blocks = $(".block"); var testEffect = setInterval(function() { $(blocks[count - 1]).removeClass("hover"); $(blocks[count]).addClass("hover"); count++; if (count > 4) clearInterval(testEffect); }, 800); }); </script>