<!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 type="text/javascript">
function ShowHeader() {
var txt = document.getElementById("header").innerHTML;
var subLen = 0;
var iniTime = 100;
Show();
function Show() {
var len = txt.length;
document.getElementById("header").innerHTML = txt.substring(0, subLen);
subLen++;
if (subLen > len) {
subLen = 1;
document.getElementById("header").innerHTML ='';
window.setTimeout("Show()", 100);
}
else {
window.setTimeout("Show()", 100);
}
}
}
</script>
</head>
<body onload="ShowHeader()">
<form action="">
<label id="header">欢迎注册我们的网站</label>
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
function ShowHeader() {
var txt = document.getElementById("header").innerHTML;
var subLen = 0;
var iniTime = 100;
Show();
function Show() {
var len = txt.length;
document.getElementById("header").innerHTML = txt.substring(0, subLen);
subLen++;
if (subLen > len) {
subLen = 1;
document.getElementById("header").innerHTML ='';
window.setTimeout("Show()", 100);
}
else {
window.setTimeout("Show()", 100);
}
}
}
</script>
</head>
<body onload="ShowHeader()">
<form action="">
<label id="header">欢迎注册我们的网站</label>
</form>
</body>
</html>
解决方案 »
- js基本上没学过,直接学上jquery好不好?
- 求一JS效果:设置时间(比如:10秒)显示图片
- 关于鼠标事件,像这样的过程,如何用编写?
- JS 如何判断 是否为input标签 急!急!急!急!急!
- 请问,这段JS,为什么在IE6内只能实现一次啊?~谢谢!
- 子页面提交数据后,如何让整个页面刷新
- 为什么AJAX也就是XMLHTTP为什么只能返回英文,要是中文就为空!!!!!!!!!
- 如何结合html实现程序关键字的高亮显示/蓝色显示呢
- 高分求教---根据下拉框的不同选择,动态添加删除表格行或改变表格项的名称怎么做?
- 新人求帮助。。。
- jquery一个插件问题一个地方不明白 高手请进..................
- 我用jquery里的animate方法写个移动,在移动超出div的时候使超出隐藏起来要怎么写
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
function ShowHeader() {
var txt = document.getElementById("header").innerHTML;
var subLen = 0;
var iniTime = 100;
function Show() {
var len = txt.length;
document.getElementById("header").innerHTML = txt.substring(0, subLen);
subLen++;
if (subLen > len) {
subLen = 1;
document.getElementById("header").innerHTML ='';
window.setTimeout(function(){Show()}, 100);
}
else {
window.setTimeout(function(){Show()}, 100);
}
}
Show()
}
</script>
</head>
<body onload="ShowHeader()">
<form action="">
<label id="header">欢迎注册我们的网站</label>
</form>
</body>
</html>