<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <div class="g-index"> <div class="right"> <div > <ul id="demo"> <li>1111</li> <li>2222</li> <li>3333</li> <li>4444</li> <li>5555</li> <li>6666</li> </ul> </div> </div> </body> <script src="./js/jquery.min.js"></script> <script> function change() { var body=$("#demo"); body.append(body.children().first()); } $(document).ready(function() { $("#demo").mouseenter(function () { clearInterval(MyMar1) }); $("#demo").mouseleave(function () { MyMar1 = setInterval(change, 1000); }); }); var MyMar1=setInterval(change,1000); </script> </html>
标签:jQuery,function,滚动,表格,demo,body,MyMar1,change From: https://www.cnblogs.com/zzc666/p/17729058.html