蓝汛科技股票:javascript程序编程

来源:百度文库 编辑:高考问答 时间:2024/04/29 16:50:34
题目:在页面的一个矩形容器中,显示若干条自下向上循环滚动的新闻标题。当鼠标光标移入容器时,新闻标题停止滚动,鼠标光标移出容器时,新闻标题继续滚动。每个新闻标题均可链接到某个新闻内容页面(URL可以虚构)。超链接默认没有下划线,当鼠标光标移到链接上时显示下划线。

这个好说,用CSS+marquee就可以了,代码如下:

<html>
<head>
<style type="text/css">
<!--
A:link{font-weight:normal; color:#000000; font-size:12px; text-decoration:none; font-family:宋体}
A:visited{font-weight:normal; color:#858585; font-size:12px; text-decoration:none; font-family:宋体}
A:hover{font-weight:normal; color:#ff0000; font-size:12px; text-decoration:underline; font-family:宋体}
-->
</style>
</head>
<body>
<table width="20%" align=center border=1><tr><td>
<marquee direction=up TrueSpeed scrollAmount=1 scrollDelay=40 width=100% height=140 onMouseOut=Javascript:this.start(); onMouseOver=Javascript:this.stop(); >
<table align=center>
<tr><td><a href="http://www.126.com">网易126邮箱</a></td></tr>
<tr><td><a href="http://www.126.com">网易126邮箱</a></td></tr>
<tr><td><a href="http://www.126.com">网易126邮箱</a></td></tr>
<tr><td><a href="http://www.126.com">网易126邮箱</a></td></tr>
<tr><td><a href="http://www.126.com">网易126邮箱</a></td></tr>
<tr><td><a href="http://www.126.com">网易126邮箱</a></td></tr>
<tr><td><a href="http://www.126.com">网易126邮箱</a></td></tr>
<tr><td><a href="http://www.126.com">网易126邮箱</a></td></tr>
</table>
</marquee>
</td></tr></table>
</body>
</html>

这段代码在我本机测试过了,可以运行,完全符合你的要求:)

<html>
<head>
<title> New Document </title>
<style>
A.News
{
FONT-SIZE:12px;
TEXT-decoration : none;
COLOR:#003366;
}
A.News:active
{
FONT-SIZE:12px;
TEXT-decoration : underline;
COLOR:#003366;
}
A.News:link
{
FONT-SIZE:12px;
TEXT-decoration : none;
COLOR:#003366;
}
A.News:visited
{
FONT-SIZE:12px;
TEXT-decoration : none;
COLOR:#003366;
}
A.News:hover
{
FONT-SIZE:12px;
TEXT-decoration : underline;
COLOR:#990000;
}
</style>
</head>

<body>
<MARQUEE onmouseover=this.stop() onmouseout=this.start()
scrollAmount=1 file://这里设置滚动速度,将1改成其它数看看
scrollDelay=4 direction=up
width=168 height=110 file://设置滚动区域的宽高
style="line-height: 150%; "><a href="http://www.baidu.com" class="News">www.baidu.com</a><br>
<a href="#" class="News">E网资源站</a><br>
<a href="#" class="News">教程特效</a><br>
<a href="#" class="News">电影音乐</a></MARQUEE>

</body>
</html>

同意