当前位置: 首页 > 图文教程 > 网络编程 > Javascript > 跑马灯效果大全

Javascript
web开发设计师比较费解的JavaScript
jQuery教程:整理的几个常见的初学者问题
免费资源:7个效果非常棒的jQuery 3D效果插件
JavaScript教程:编写匿名函数的几种方法
jQuery教程:jQuery的核心
jQuery教程:jQuery核心方法的使用
webjx收集45个jQuery导航插件和教程
30个气泡悬浮框(Tooltip)的jQuery插件
Jetpack扩展案例:Gmail邮件提醒功能
非常出色的jQuery运动特效可以和Flash媲美
ImagesLazyLoad 图片延迟加载效果
收集国外的14个图片放大编辑的jQuery插件
修改和创建DOM节点两种方式的4种优化方案
jQuery.Switchable整合插件用途介绍
提高Textarea操作性能优秀的jQuery插件
WEBJX收集12个非常有创意的JavaScript小游戏
Javascript教程:关于深入了解JS的几个问题

Javascript 中的 跑马灯效果大全


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 122 ::
收藏到网摘: n/a

复制代码 代码如下:

<html>
<head><title>跑马灯大全</title>
<script LANGUAGE="JavaScript">
<!-- Begin
var Mes=new Array();
Mes[0]="洪恩在线欢迎你! ";
Mes[1]="感谢你关注电脑交互教程 ";
Mes[2]="网页制作技巧 之 跑马灯大全 ";
var place=1;
var i=0;
function scroll()
{
window.status=Mes[i].substring(0, place);
if (place >= Mes[i].length)
{
if(i<2)
{
i++;
place=1;
window.setTimeout("scroll()",50);
}
else
{
i=0;
place=1;
window.setTimeout("scroll()",50);
}
}
else {
place++;
window.setTimeout("scroll()",50);
}
}
// End -->
</script>
</head>
<form name="shooterform" method="get">
<body onload="scroll();">
<marquee>滚动的文字</marquee>
<marquee behavior=alternate>表示双向移动</marquee>
<marquee direction=left>表示运动方向向左</marquee>
<marquee width=400 behavior=alternate direction=left align=middle border=1>弹来弹去跑马灯!</marquee>
<marquee scrollamount="30">表示运动方向向左</marquee>
<marquee width=90%>
<a href="http://www.hongen.com/default.htm" target=_blank>带有超链接的跑马灯!点我试试?</a><br />
<a href="http://www.hongen.com/pc/index.htm" target=_blank>还有一条呢!点我试试?</a>
</marquee>
<table width="93%" border="1" cellspacing="0" cellpadding="1" align="center" class="p1">
<tr>
<td width="42%">参数</td>
<td width="58%">用法介绍</td>
</tr>
<tr>
<td width="42%">behavior=scroll, slide, alternate</td>
<td width="58%">跑马方式:循环绕行,只跑一次就停住,来回往复运动</td>
</tr>
<tr>
<td width="42%">direction=left,right</td>
<td width="58%">跑马方向:从左向右,从右向左</td>
</tr>
<tr>
<td width="42%">loop=100</td>
<td width="58%">跑马次数:循环100次,如不写默认为一直循环</td>
</tr>
<tr>
<td width="42%">width=100%,height=200</td>
<td width="58%">跑马范围:宽为100%,高为200像素</td>
</tr>
<tr>
<td width="42%">scrollamount=20</td>
<td width="58%">跑马速度:数越大越快</td>
</tr>
<tr>
<td width="42%">scrolldelay=500</td>
<td width="58%">跑马延时:毫秒数,利用它可实现跃进式滚动</td>
</tr>
<tr>
<td width="42%">hspace=20,vspace=20</td>
<td width="58%">跑马区域与其它区域间的空白大小</td>
</tr>
<tr>
<td width="42%">bgcolor=#00FFCC</td>
<td width="58%">跑马区域的背景颜色</td>
</tr>
</table>
  

</body>
</form>
</html>