文字来回上下移动或跳动的代码
作者:bea
<!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> <meta http-equiv="Content-Type" content="text
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>文字来回上下移动或跳动</title>
</head>
<body>
<script language="JavaScript">
<!--
done = 0;
step = 4
function anim(yp,yk)
{
if(document.layers) document.layers["napis"].top=yp;
else document.all["napis"].style.top=yp;
if(yp>yk) step = -4
if(yp<60) step = 4
setTimeout('anim('+(yp+step)+','+yk+')', 10);
}
function start()
{
if(done) return
done = 1;
if(navigator.appName=="Netscape") {
document.napis.left=innerWidth/2 - 145;
anim(60,innerHeight - 60)
}
else {
napis.style.left=280;
anim(60,document.body.offsetHeight - 60)
}
}
//-->
</script>
<div id="napis"
style="position: absolute; top: 159px; width: 400px; height: 78px; left: 215px"><font size="5"><b>欢迎您的到来!</b></font></div>
<script language="JavaScript">
<!--
setTimeout('start()',10);
//-->
</script>
</body>
</html>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行]
有用 | 无用
猜你喜欢
您可能感兴趣的文章:
- JQuery SELECT单选模拟jQuery.select.js
- Jquery操作Select 简单方便 一个js插件搞定
- jquery控制listbox中项的移动并排序
- Jquery 获取表单text,areatext,radio,checkbox,select值的代码
- 两个select之间option的互相添加操作(jquery实现)
- XHTML下,JS浮动代码失效的问题
- 把html页面的部分内容保存成新的html文件的jquery代码
- Javascript 定时器调用传递参数的方法
- Ext.FormPanel 提交和 Ext.Ajax.request 异步提交函数的区别
- JS解析XML的实现代码
- 跨域表单提交状态的变相判断代码
- JS 中document.URL 和 windows.location.href 的区别
- ASP中进行HTML数据及JS数据编码函数
- javascript 日期常用的方法
- Jquery在IE7下无法使用 $.ajax解决方法
- jQuery 白痴级入门教程
- Javascript 解疑
- 不一样的文字闪烁 轮番闪烁
- JS旋转的彩色文字轮转特效