jquery
한줄 스크롤 - 전광판처럼 기능
aneyh.c
2012. 2. 17. 17:12
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<style>
#tested { margin-bottom:5px; height:20px; overflow:hidden; list-style:none; line-height:120%; }
</style>
<script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
<script type="text/javascript">
function tested() {
var tested = $("#tested");
tested.animate({marginTop:"-25px"}, 200, null, function() {
tested.css("marginTop", "0px").append(tested.find("> li:first"));
});
}
setInterval("tested()", 2000);
</script>
</head>
<body>
<ul id="tested">
<li>- aaaaa1</li>
<li>- bbbbb2</li>
<li>- ccccc3</li>
<li>- ddddd4</li>
</ul>
</body>
</html>