jquery广告无缝轮播实例
2019/6/27 21:30:41
本文主要是介绍jquery广告无缝轮播实例,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
本文实例为大家演示了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="js/jquery.min.js"></script> </head> <body> <div class="mains"> <div class="title">jquery广告无缝轮播代码演示</div> <div class="g1" style="overflow: hidden;"> <ul id="ulID" style="position: relative; height: 1800px; width: 380px; top: 0px;"> <li style="width: 380px; height: 180px; float: left;"> <img src="img/1.jpg" style="width: 380px; height: 180px;"></li> <li style="width: 380px; height: 180px; float: left;"> <img src="img/2.jpg" style="width: 380px; height: 180px;"></li> <li style="width: 380px; height: 180px; float: left;"> <img src="img/3.jpg" style="width: 380px; height: 180px;"></li> <li style="width: 380px; height: 180px; float: left;"> <img src="img/4.jpg" style="width: 380px; height: 180px;"></li> <li style="width: 380px; height: 180px; float: left;"> <img src="img/5.jpg" style="width: 380px; height: 180px;"></li> <li style="width: 380px; height: 180px; float: left;"> <img src="img/1.jpg" style="width: 380px; height: 180px;"></li> <li style="width: 380px; height: 180px; float: left;"> <img src="img/2.jpg" style="width: 380px; height: 180px;"></li> <li style="width: 380px; height: 180px; float: left;"> <img src="img/3.jpg" style="width: 380px; height: 180px;"></li> <li style="width: 380px; height: 180px; float: left;"> <img src="img/4.jpg" style="width: 380px; height: 180px;"></li> <li style="width: 380px; height: 180px; float: left;"> <img src="img/5.jpg" style="width: 380px; height: 180px;"></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>
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持找一找教程网。
这篇关于jquery广告无缝轮播实例的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-30React Native常用组件-点击组件
- 2024-05-30uniapp+vue3+uv-ui手机端后台OA管理模板
- 2024-05-29Python网络爬虫的时候json=就是让你少写个json.dumps()
- 2024-05-27React Native常用组件-展示组件
- 2024-05-27React Native常用组件-列表组件
- 2024-05-09vue3开发前端表单缓存自定义指令,移动端h5必备插件
- 2024-05-09React Hooks在class组件中的使用方式
- 2024-03-30[OIDC in Action] 2. 基于OIDC(OpenID Connect)的SSO(纯JS客户端)
- 2024-03-29terraform jsonencode
- 2024-03-13vuex-persist