jquery广告无缝轮播实例


Posted in Javascript onJanuary 05, 2017

本文实例为大家演示了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>

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持三水点靠木。

Javascript 相关文章推荐
js 获取(接收)地址栏参数值的方法
Apr 01 Javascript
js保留小数点后几位的写法
Jan 03 Javascript
js 判断控件获得焦点的示例代码
Mar 04 Javascript
jQuery mobile转换url地址及获取url中目录部分的方法
Dec 04 Javascript
Vue.js实现一个自定义分页组件vue-paginaiton
Sep 05 Javascript
easyui-datagrid特殊字符不能显示的处理方法
Apr 12 Javascript
完美解决浏览器跨域的几种方法(汇总)
May 08 Javascript
vue 2.0路由之路由嵌套示例详解
May 08 Javascript
jQuery Autocomplete简介_动力节点Java学院整理
Jul 17 jQuery
js实现手机web图片左右滑动效果
Dec 29 Javascript
jQuery控制input只能输入数字和两位小数的方法
May 16 jQuery
Javascript的promise,async和await的区别详解
Mar 24 Javascript
JavaScript自定义浏览器滚动条兼容IE、 火狐和chrome
Jan 05 #Javascript
javascript添加前置0(补零)的几种方法
Jan 05 #Javascript
微信小程序 实战实例开发流程详细介绍
Jan 05 #Javascript
利用jquery禁止外层滚动条的滚动
Jan 05 #Javascript
bootstrap table配置参数例子
Jan 05 #Javascript
bootstrap table 表格中增加下拉菜单末行出现滚动条的快速解决方法
Jan 05 #Javascript
AngularJS中update两次出现$promise属性无法识别的解决方法
Jan 05 #Javascript
You might like
PHP开发中四种查询返回结果分析
2011/01/02 PHP
php array_pop()数组函数将数组最后一个单元弹出(出栈)
2011/07/12 PHP
PHP正确解析UTF-8字符串技巧应用
2012/11/07 PHP
tp5(thinkPHP5)操作mongoDB数据库的方法
2018/01/20 PHP
JavaScript 创建对象
2009/07/17 Javascript
Firefox+FireBug使JQuery的学习更加轻松愉快
2010/01/01 Javascript
JS代码放在head和body中的区别分析
2011/12/01 Javascript
JavaScript 中的日期和时间及表示标准介绍
2013/08/21 Javascript
百度UEditor编辑器如何关闭抓取远程图片功能
2015/03/03 Javascript
AngularJS快速入门
2015/04/02 Javascript
jQuery+HTML5美女瀑布流布局实现方法
2015/09/21 Javascript
JS组件Bootstrap Table使用方法详解
2016/02/02 Javascript
javascript html5移动端轻松实现文件上传
2020/03/27 Javascript
Bootstrap中的Panel和Table全面解析
2016/06/13 Javascript
利用Node.js了解与测量HTTP所花费的时间详解
2017/09/22 Javascript
Vue filter介绍及其使用详解
2017/10/21 Javascript
jQuery niceScroll滚动条错位问题的解决方法
2018/02/03 jQuery
详解express + mock让前后台并行开发
2018/06/06 Javascript
python 多线程实现检测服务器在线情况
2015/11/25 Python
PyQt实现界面翻转切换效果
2018/04/20 Python
python2.7实现爬虫网页数据
2018/05/25 Python
在Pycharm中项目解释器与环境变量的设置方法
2018/10/29 Python
深入理解Python异常处理的哲学
2019/02/01 Python
对python中url参数编码与解码的实例详解
2019/07/25 Python
python Shapely使用指南详解
2020/02/18 Python
scrapy爬虫:scrapy.FormRequest中formdata参数详解
2020/04/30 Python
HTML5 声明兼容IE的写法
2011/05/16 HTML / CSS
adidas官方旗舰店:德国运动用品制造商
2017/11/25 全球购物
迪奥美国官网:Dior美国
2019/12/07 全球购物
DJI全球:DJI Global
2021/03/15 全球购物
公司授权委托书
2014/04/04 职场文书
2014年大学教师工作总结
2014/12/02 职场文书
员工离职感谢信
2015/01/22 职场文书
小学生光盘行动倡议书
2015/04/28 职场文书
人生哲理妙语30条:淡写流年,笑过人生
2019/09/04 职场文书
Python PIL按比例裁剪图片
2022/05/11 Python