| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 678 人关注过本帖
标题:javascript打字机效果
只看楼主 加入收藏
alipro
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-3-24
收藏
 问题点数:0 回复次数:0 
javascript打字机效果

<!--作者http://www.adoris.cn-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Type Writer</title>
<style type="text/css">
.link{font-family:verdana,arial,helvetica; font-size:8pt; color:#003399; font-weight:normal}
.link:hover{font-family:verdana,arial,helvetica; font-size:8pt; color:#0099FF; font-weight:normal}
.prem_hint{font-family:verdana,arial,helvetica; font-size:8pt; color:#000000; font-weight:normal}
.header{font-family:arial,verdana,helvetica; font-size:20pt; color:#FA5D00; font-weight:bold}
</style>
<!--BEGIN REQUIRED-->
<script language="javascript">

window.onerror = null;
var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var NS4 = (bName == "Netscape" && bVer >= 4);
var IE4 = (bName == "Microsoft Internet Explorer"
&& bVer >= 4);
var NS3 = (bName == "Netscape" && bVer < 4);
var IE3 = (bName == "Microsoft Internet Explorer"
&& bVer < 4);
var time_length =100; //Scroll speed
var begin_pos=55;
var left_pos=110;
var i=1;
var text_type = "打字机效果。阿多里斯编程网是一个综合性编程网站,为你提供大量的实用性编程";
text_type+="实例与代码,并有专业人士为你解答问题";
var text_type_len= text_type.length;
function type()
{
for(var i=1; i<=text_type_len; i++)
{
document.write('<div id="' + text_type + i + '" style="position:absolute; visibility:hidden; top:' + begin_pos + '; left:' + (left_pos+15*i) + '">');
document.write('<font face="verdana,arial,helvetica" size="2" color="#003399"><b>' + text_type.charAt(i-1) + '</b></font></div>');
}
dotype();
}

function dotype()
{
setTimeout("Show('"+text_type+i+"')",time_length);
}

if (NS4 || IE4) {
if (navigator.appName == "Netscape") {
layerStyleRef="layer.";
layerRef="document.layers";
styleSwitch="";
}else{
layerStyleRef="layer.style.";
layerRef="this.document.all";
styleSwitch=".style";
}
}

//SHOW
function Show(layerName){
if (NS4 || IE4) {
eval(layerRef+'["'+layerName+'"]'+
styleSwitch+'.visibility="visible"');
if(i<text_type_len)
{
i++;
dotype();
}
}
}

type();

</script>
<!--END REQUIRED-->
</head>
<body bgcolor="#FFFFFF">
<center>
<span class="header">打字机效果</span>
<br>

<br><br>
<table align="center" width="400"><tr><td>
<font face="verdana,arial,helvetica" size="-1" color="#000000">
这个javascript代码实现的上述的打字机效果.<br><br>
你可能通过修改变量的值来修改显示文字和打字坐标等效果 <font face="courier">text_type</font>


</td></tr></table>
<br>
<center><a href="http://www.adoris.cn" class="link">阿多里斯编程网</a></center>
</body>
</html>


搜索更多相关主题的帖子: 打字机 javascript 效果 
2007-08-15 09:55
快速回复:javascript打字机效果
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018315 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved