js文字滚动事件

js文字滚动事件

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			.inner{position:relative;height:70px;margin:100px auto;display:block;overflow:hidden;}
			ul,li{list-style:none;}
			ul{height:70px;}
			li{height:15px;margin-top:5px;}
			
		</style>
	</head>
	<body>
		<div class="inner">
			<ul>
				<li>111111111111111111</li>
				<li>222222222222222222</li>
				<li>333333333333333333</li>
				<li>444444444444444444</li>
				<li>555555555555555555</li>
				<li>666666666666666666</li>
			</ul>
		</div>
	</body>
	<script type="text/javascript" src="../js/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" src="../js/animate.js"></script>
	<script type="text/javascript">
		function autoScroll(obj){
			$(obj).find("ul").animate({
				"marginTop":"-15px"
			},1000,function(){
				$(this).css({"marginTop":"0"});
				$("li:first-child").appendTo(this);
			})
		}
		setInterval('autoScroll(".inner")',1500);
	</script>
</html>

posted @ 2019-03-01 16:15  lxystar  阅读(183)  评论(0)    收藏  举报