首页 > 其他 > 详细

文字上下滑动

时间:2015-04-27 00:24:37      阅读:208      评论:0      收藏:0      [点我收藏+]

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
.txt {width: 20px;margin:0 auto;}
</style>
<script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
</head>
<body>

<script type="text/javascript">
$(function(){
var textScroll = function(selector) {
var stepTime = 1000, //动画执行时间
intervalTime = stepTime * 2,
$text = $(selector);
$text.css("position","relative");
setInterval(function(){
$text.animate({
top:‘100px‘}, stepTime, ‘linear‘, function(){
$text.animate({top:0}, stepTime)
}
)
}, intervalTime);
};
textScroll (".box");
// textScroll (".box");//增加用
});

</script>
<div class="box">
<div class="txt">
我就是要上下跳动
</div>
</div>
</body>
</htm>

文字上下滑动

原文:http://www.cnblogs.com/warmth89/p/4458743.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!