1. 程式人生 > >跑馬燈寫新聞滾動的效果

跑馬燈寫新聞滾動的效果

跑馬燈<marquee></marquee> 網頁中有滾動效果

1、direction="down"  走馬燈的方向

2、scrollamount="10" 滾動時的速度是多少

3、behavior="alternata/scroll/slide"  行為:往復運動/轉圈/行為停靠

4、只針對跑馬燈有效:onmouseover="this.stop()"  滑鼠移到上面停止滾動

                                      onmouseout="this.start()"     滑鼠移下去滾動開始

<DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>跑馬燈</title>
		<style type="text/css">
			body{
				height: 30px;
				width: 300px;
				
			}
			.color {
				background-color: #111F44;
			}
            a{
            	display: block;
            	color: #1171A1;
            }
		</style>
	</head>
	<body>
		<marquee direction="down" onmouseover="this.stop()" onmouseout="this.start()" class="color">
			<a href="#">新聞新聞新聞新聞新聞新聞新聞11</a>
			<a href="#">新聞新聞新聞新聞新聞新聞新聞10</a>
			<a href="#">新聞新聞新聞新聞新聞新聞新聞9</a>
			<a href="#">新聞新聞新聞新聞新聞新聞新聞8</a>
			<a href="#">新聞新聞新聞新聞新聞新聞新聞7</a>
			<a href="#">新聞新聞新聞新聞新聞新聞新聞6</a>
			<a href="#">新聞新聞新聞新聞新聞新聞新聞5</a>
			<a href="#">新聞新聞新聞新聞新聞新聞新聞4</a>
			<a href="#">新聞新聞新聞新聞新聞新聞新聞3</a>
			<a href="#">新聞新聞新聞新聞新聞新聞新聞2</a>
			<a href="#">新聞新聞新聞新聞新聞新聞新聞1</a>
		</marquee>
	</body>
</html>

 

效果圖