jquery广告无缝轮播实例

需要自行添加五张图片和引用jquery

纵向轮播实例:

<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>jquery广告无缝轮播代码演示</title> <style type="text/css"> li{ list-style:none; } .mains{ width:700px; margin:0 auto; } .mains .title{ font-size:25px; padding:10px 0 5px 50px; } .g1{ width:380px; height:180px; } </style> <script type="text/javascript" src="https://www.jb51.net/js/jquery.min.js"></script> </head> <body> <div> <div>jquery广告无缝轮播代码演示</div> <div> <ul> <li> <img src="https://www.jb51.net/img/1.jpg"></li> <li> <img src="https://www.jb51.net/img/2.jpg"></li> <li> <img src="https://www.jb51.net/img/3.jpg"></li> <li> <img src="https://www.jb51.net/img/4.jpg"></li> <li> <img src="https://www.jb51.net/img/5.jpg"></li> <li> <img src="https://www.jb51.net/img/1.jpg"></li> <li> <img src="https://www.jb51.net/img/2.jpg"></li> <li> <img src="https://www.jb51.net/img/3.jpg"></li> <li> <img src="https://www.jb51.net/img/4.jpg"></li> <li> <img src="https://www.jb51.net/img/5.jpg"></li> </ul> </div> </div> <script type="text/javascript"> var PlaceTop = parseInt($("#ulID").css("top")); var int; function moveUL(){ var ulID = $("#ulID"); PlaceTop = --PlaceTop; if(PlaceTop == -900) { PlaceTop = 0; } ulID.css("top",PlaceTop); if(PlaceTop < -900){ alert("Eror!"); clearInterval(int); } } int=setInterval("moveUL()",10); $(".g1").hover(function(){ clearInterval(int); },function(){ int=setInterval("moveUL()",10); }); </script> </body> </html>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wwjwpj.html