如果要在網頁的Title製造動態的顯示效果 可以用以下的這段程式來完成
請將這一段程式放到您的網頁裏面
前後用包起來…
您就可以看到這段效果了
資料參考來源http://www.dynamicdrive.com/
提示您…加入完之後請往左上角看

var titletext="歡迎來到湯瑪的吳BLOG"
var thetext=""
var started=false
var step=0
var times=1

function welcometext()
{
times--
if (times==0)
{
if (started==false)
{
started = true;
document.title = titletext;
setTimeout("anim()",1);
}
thetext = titletext;
}
}

function showstatustext(txt)
{
thetext = txt;
setTimeout("welcometext()",4000)
times++
}

function anim()
{
step++
if (step==7) {step=1}
if (step==1) {document.title='>==='+thetext+'===<'}
if (step==2) {document.title='=>=='+thetext+'==<='}
if (step==3) {document.title='>=>='+thetext+'=<=<'}
if (step==4) {document.title='=>=>'+thetext+'<=<='}
if (step==5) {document.title='==>='+thetext+'=<=='}
if (step==6) {document.title='===>'+thetext+'<==='}
setTimeout("anim()",200);
}

if (document.title)
window.onload=onload=welcometext
arrow
arrow
    全站熱搜

    湯瑪的吳 發表在 痞客邦 留言(0) 人氣()