<html>
<head>
<title>打字效果</title>
<meta http-equiv=
"Content-Type"
Content=
"text/html;charset=gb2312"
/>
<style type=
"text/css"
>
body{
font-size:14px;
font-color:
#purple;
font-weight:bolder;
}
</style>
</head>
<body>
最新内容: <a id =
"Hotnews"
href=
""
target=
"_blank"
> </a>
<script language=
"javascript"
>
var
NewsTime = 2000;
var
TextTime = 100;
var
newsi = 0;
var
txti = 0;
var
txttimer;
var
newstimer;
var
newstitle =
new
Array();
var
newshref =
new
Array();
newstitle[0] =
"欢迎来到我的博客"
;
newshref[0] =
"http://www.jb51.net/guihailiuli/"
;
newstitle[1] =
"http://www.jb51.net/guihailiuli/"
;
newshref[1] =
"http://www.jb51.net/guihailiuli/"
;
newstitle[2] =
"博客园欢迎你哦"
;
newshref[2] =
"http://www.jb51.net"
;
newstitle[3] =
"ByeBye~~"
;
newshref[3] =
"http://www.jb51.net"
;
function
shownew(){
hwnewstr=newstitle[newsi];
newslink=newshref[newsi];
if
(txti>=hwnewstr.length){
clearInterval(txttimer);
clearInterval(newstimer);
newsi++;
if
(newsi>=newstitle.length){
newsi = 0;
}
newstimer = setInterval(
"shownew()"
,NewsTime);
txti = 0;
return
;
}
clearInterval(txttimer);
document.getElementById(
"Hotnews"
).href = newslink;
document.getElementById(
"Hotnews"
).innerHTML = hwnewstr.substring(0,txti+1);
txti++;
txttimer = setInterval(
"shownew()"
,TextTime);
}
shownew();
</script>
</body>
</html>