jQuery实现的文字逐行向上间歇滚动效果示例


Posted in jQuery onSeptember 06, 2017

本文实例讲述了jQuery实现的文字逐行向上间歇滚动效果。分享给大家供大家参考,具体如下:

运行效果图如下:

jQuery实现的文字逐行向上间歇滚动效果示例

具体代码如下:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>3water.com jQuery文字逐行向上滚动代码</title>
<link href="css/index.css" rel="external nofollow" rel="stylesheet" type="text/css">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<style>
*{ margin:0px; padding:0px; font-family:'微软雅黑'; -webkit-tap-highlight-color:rgba(0,0,0,0); }
li{ list-style:none }
img{ border:none}
a{text-decoration:none;}
/* -------------------------摇奖排行榜----------------------------------- */
.Top_Record{}
.record_Top{width:90%; height:50px; text-align:center; line-height:50px; margin:30px auto 0px; color:#000;}
.topRec_List dl,.maquee{ width:90%; overflow:hidden; margin:0 auto; color:#7C7C7C}
.topRec_List dd{ float:left; text-align:center; border-bottom:1px solid #1B96EE; color:#1B96EE;}
.topRec_List dl dd:nth-child(1){ width:17%; height:40px; line-height:40px; }
.topRec_List dl dd:nth-child(2){ width:18%; height:40px; line-height:40px; }
.topRec_List dl dd:nth-child(3){ width:25%; height:40px; line-height:40px; }
.topRec_List dl dd:nth-child(4){ width:40%; height:40px; line-height:40px; }
.maquee{ height:195px;}
.topRec_List ul{ width:100%; height:195px;}
.topRec_List li{ width:100%; height:38px; line-height:38px; text-align:center; font-size:12px; border-bottom: 1px dashed #aaa;}
/*.topRec_List li:nth-child(2n){ background:#077cd0}*/
.topRec_List li div{ float:left;}
.topRec_List li div:nth-child(1){ width:17%;}
.topRec_List li div:nth-child(2){ width:18%;}
.topRec_List li div:nth-child(3){ width:25%;}
.topRec_List li div:nth-child(4){ width:40%;}
.apple a{display:block; text-decoration:none;}
.apple,.aa{ width:90%; height:50px; overflow:hidden; margin:30px auto; border:1px solid #1B96EE;}
.apple a,.aa a{ width:100%; height:50px; line-height:50px; text-indent:20px; color:#1B96EE;}
.aa {word-wrap:break-word;line-height:50px; color:#1B96EE;}
</style>
</head>
<body>
<div class="Top_Record">
  <div class="record_Top">摇奖排行榜</div>
  <div class="topRec_List">
    <dl>
      <dd>编号</dd>
      <dd>姓名</dd>
      <dd>奖项</dd>
      <dd>时间</dd>
    </dl>
    <div class="maquee">
      <ul>
        <li>
          <div>1</div>
          <div>王**</div>
          <div>中了30元</div>
          <div>2014/12/30 14:20</div>
        </li>
        <li>
          <div>2</div>
          <div>王**</div>
          <div>中了30元</div>
          <div>2014/12/30 14:20</div>
        </li>
        <li>
          <div>3</div>
          <div>王**</div>
          <div>中了30元</div>
          <div>2014/12/30 14:20</div>
        </li>
        <li>
          <div>4</div>
          <div>王**</div>
          <div>中了30元</div>
          <div>2014/12/30 14:20</div>
        </li>
        <li>
          <div>5</div>
          <div>王**</div>
          <div>中了30元</div>
          <div>2014/12/30 14:20</div>
        </li>
        <li>
          <div>6</div>
          <div>王**</div>
          <div>中了30元</div>
          <div>2014/12/30 14:20</div>
        </li>
        <li>
          <div>7</div>
          <div>王**</div>
          <div>中了30元</div>
          <div>2014/12/30 14:20</div>
        </li>
        <li>
          <div>8</div>
          <div>王**</div>
          <div>中了30元</div>
          <div>2014/12/30 14:20</div>
        </li>
      </ul>
    </div>
  </div>
</div>
<script type="text/javascript">
  function autoScroll(obj){
    $(obj).find("ul").animate({
      marginTop : "-39px"
    },1000,function(){
      $(this).css({marginTop : "0px"}).find("li:first").appendTo(this);
    })
  }
  $(function(){
    var scroll=setInterval('autoScroll(".maquee")',1500);
     $(".maquee").hover(function(){
      console.log("aaa");
      clearInterval(scroll);
     },function(){
      scroll=setInterval('autoScroll(".maquee")',1500);
     });
  });
</script>
</body>
</html>

希望本文所述对大家jQuery程序设计有所帮助。

jQuery 相关文章推荐
基于jquery实现二级联动效果
Mar 30 jQuery
jQuery 表单序列化实例代码
Jun 11 jQuery
详解jQuery中关于Ajax的几个常用的函数
Jul 17 jQuery
Jquery中.bind()、.live()、.delegate()和.on()之间的区别详解
Aug 01 jQuery
jQuery实现的简单动态添加、删除表格功能示例
Sep 21 jQuery
JavaScript实现离开页面前提示功能【附jQuery实现方法】
Sep 26 jQuery
jQuery实现左右滑动的toggle方法
Mar 03 jQuery
jQuery实现的简单手风琴效果示例
Aug 29 jQuery
jQuery实现input[type=file]多图预览上传删除等功能
Aug 02 jQuery
jquery实现简单拖拽效果
Jul 20 jQuery
jquery实现简易验证插件封装
Sep 13 jQuery
jQuery实现推拉门效果
Oct 19 jQuery
jquery实现限制textarea输入字数的方法
Sep 06 #jQuery
jquery实现用户登陆界面(示例讲解)
Sep 06 #jQuery
jQuery实现注册会员时密码强度提示信息功能示例
Sep 05 #jQuery
jquery+css实现下拉列表功能
Sep 03 #jQuery
jQuery中.attr()和.data()的区别分析
Sep 03 #jQuery
jQuery Ajax向服务端传递数组参数值的实例代码
Sep 03 #jQuery
jquery tmpl模板(实例讲解)
Sep 02 #jQuery
You might like
php递归遍历删除文件的方法
2015/04/17 PHP
jQuery实战之品牌展示列表效果
2011/04/10 Javascript
解析JSON对象与字符串之间的相互转换
2013/12/18 Javascript
jQuery中:button选择器用法实例
2015/01/04 Javascript
Jquery的基本对象转换和文档加载用法实例
2015/02/25 Javascript
JS+CSS实现精美的二级导航效果代码
2015/09/17 Javascript
JavaScript中对DOM节点的访问、创建、修改、删除
2015/11/16 Javascript
js判断鼠标位置是否在某个div中的方法
2016/02/26 Javascript
jQuery实现的简单百分比进度条效果示例
2016/08/01 Javascript
vue2.0开发实践总结之疑难篇
2016/12/07 Javascript
AngularJS实现根据不同条件显示不同控件
2017/04/20 Javascript
webpack进阶——缓存与独立打包的用法
2017/08/02 Javascript
微信小程序使用gitee进行版本管理
2018/09/20 Javascript
微信小程序用canvas画图并分享
2020/03/09 Javascript
基于leaflet.js实现修改地图主题样式的流程分析
2020/05/15 Javascript
eslint+prettier统一代码风格的实现方法
2020/07/22 Javascript
[02:51]2014DOTA2 TI小组赛总结中国军团全部进军钥匙球馆
2014/07/15 DOTA
Python写的一个定时重跑获取数据库数据
2016/12/28 Python
python实现八大排序算法(1)
2017/09/14 Python
Python3模拟登录操作实例分析
2019/03/12 Python
Python如何使用函数做字典的值
2019/11/30 Python
解决Python图形界面中设置尺寸的问题
2020/03/05 Python
Python通过两个dataframe用for循环求笛卡尔积
2020/04/29 Python
Django设置Postgresql的操作
2020/05/14 Python
为世界各地的女性设计和生产时尚服装:ROMWE
2016/09/17 全球购物
雅诗兰黛(Estee Lauder)英国官方网站:世界顶级化妆品牌
2016/12/29 全球购物
Amara美国站:英国高端家居礼品网站,世界各地的奢侈家具品牌
2017/07/26 全球购物
英国最好的包装供应商:Priory Direct
2019/12/17 全球购物
挂职思想汇报
2013/12/31 职场文书
司法局群众路线教育实践活动开展情况总结
2014/10/25 职场文书
2014年文秘工作总结
2014/11/25 职场文书
2015年营销工作总结范文
2015/04/23 职场文书
工作时间调整通知
2015/04/24 职场文书
干货:如何写好工作计划!
2019/05/17 职场文书
Python基础之函数嵌套知识总结
2021/05/23 Python
Mysql 如何实现多张无关联表查询数据并分页
2021/06/05 MySQL