jquery文字广告
<!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>广告</title>
<script src="../js/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="updown.js" type="text/javascript"></script>
<link href="updown.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="box">
<div id="fame">
<ul id="menu">
<li>行情价+2000元收购您的爱车</li>
<li>从不打广告,骗你的,哈哈!</li>
</ul>
</div>
</div>
</body>
</html>
$(document).ready(function () {
// refresh();
setInterval("refresh()", "5000");
})
function refresh() {
var s = $("#fame");
if (!s.is(":animated"))
$("#fame").animate({ marginTop: "30px" }, "slow", function () {
$('#fame li:first').before($('#fame li:last'));
$("#fame").css("margin-top", "-24px");
});
}
body
{
text-align:center;
margin:0;
padding:0;
}
#box
{
margin: 0 auto;
margin-top: 30px;
overflow:hidden;
height: 30px;
width: 250px;
border: 1px solid red;
}
#menu
{
margin-top:-24px;
}
#menu li
{
width:250px;
height:30px;
list-style-type:none;
margin-left:-50px;
}