아 날로 그 marquee

1467 단어 htmljquerycssXHTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style>
* {
	margin: 0; padding: 0;
}
#room div {
	height: 15px; width: 100px; overflow: hidden;
	background: green;  padding:0px; margin: 0; 
}
</style>
<script src="jquery-1.3.min.js"></script>
<script>
$(document).ready(function(){
	setTimeout("scroll_room()", 3000);
});
var i_cc=2, cc;
function scroll_room () {
	$("#room").animate({ top: "-=15px"},   800);
	if (!cc) {
		cc = document.getElementById("room").getElementsByTagName("div").length;
	}
	if (i_cc++ >= cc) {
		i_cc = 2;
		setTimeout('$("#room").css("top", "15px");', 2900);
		setTimeout("scroll_room()", 3000);
	} else {
		setTimeout("scroll_room()", 3000);
	}
}
</script>
</head>

<body>
	<div style="width: 300px; height: 15px; margin: 100px auto; position:relative; background: #666; overflow: hidden;">
		<div id="room" style="position: absolute;">
			<div>11111111111</div>
			<div>222222222222</div>
			<div>33333333333</div>
			<div>444444444444</div>
			<div>55555555555</div>
		</div>
	</div>    
</body>
</html>

좋은 웹페이지 즐겨찾기