码迷,mamicode.com
首页 > 其他好文 > 详细

中奖滚动

时间:2016-06-15 12:46:32      阅读:225      评论:0      收藏:0      [点我收藏+]

标签:

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>记录滚动</title>

<style>
.panel{
width:540px;
padding:10px;
text-align: center;
background-color:#FF3C3C;
border-radius: 0 0 8px 8px;
}
h2{
color:#fff;
margin: 5px;
}
.activity{
width: 300px;
margin: 0 auto;
position: relative;
overflow: hidden;
height: 105px;
background-color: #fff;
border-radius: 5px;
}
.activity ul{
top: -15px;
padding: 0;
color: #666;
position: relative;
}
.activity li{
height: 34px;
padding:0;
font-size: 12px;
line-height: 34px;
list-style: none;
border-bottom: 1px dotted #d2d2d2;
}
</style>
</head>

<body>
<div class="panel">
<h2>活动动态</h2>
<div class="activity" id="J_Activity">
<ul>
<li>user1 获得了7折优惠券 中奖时间:2016-06-15</li>
<li>user2 获得了8折优惠券 中奖时间:2016-06-15</li>
<li>user3 获得了1折优惠券 中奖时间:2016-06-15</li>
<li>user3 获得了2折优惠券 中奖时间:2016-06-15</li>
<li>user3 获得了3折优惠券 中奖时间:2016-06-15</li>
<li>user3 获得了4折优惠券 中奖时间:2016-06-15</li>
<li>user3 获得了5折优惠券 中奖时间:2016-06-15</li>
<li>user3 获得了6折优惠券 中奖时间:2016-06-15</li>
</ul>
</div>
</div>
</body>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.js"></script>
<script type="text/javascript" charset="utf-8">
$(function () {
var listPanel = $(‘#J_Activity ul‘);
var z = 0;//向上滚动top值
function up() {//向上滚动
listPanel.animate({//中奖结果
‘top‘: (z - 35) + ‘px‘
}, 1500, ‘linear‘, function () {
listPanel.css({‘top‘: ‘0px‘})
.find("li:first").appendTo(listPanel);
up();
});
}
up();
});
</script>
</html>

中奖滚动

标签:

原文地址:http://www.cnblogs.com/www-xiaobo-com/p/5586993.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!