2008年2月4日 星期一

狀態列效果

1.將語法插入在</head>之後


 

<script language="JavaScript">

var hellotext = "歡迎您來到HeHa網頁教學製作站"

var thetext = "";

var started = false;

var step = 0;

var times = 1;


 

function welcometext() {

times--;

if (!times) {

if (!started) {

started = true;

window.status = hellotext;

setTimeout("anim()", 1);

}

thetext = hellotext;

}

}


 

function anim() {

step++;

if (step==10) step = 2;

if (step==1) window.status = '●○○○○' + thetext + '○○○○●';

if (step==2) window.status = '○●○○○' + thetext + '○○○●○';

if (step==3) window.status = '○○●○○' + thetext + '○○●○○';

if (step==4) window.status = '○○○●○' + thetext + '○●○○○';

if (step==5) window.status = '○○○○●' + thetext + '●○○○○';

if (step==6) window.status = '○○○●○' + thetext + '○●○○○';

if (step==7) window.status = '○○●○○' + thetext + '○○●○○';

if (step==8) window.status = '○●○○○' + thetext + '○○○●○';

if (step==9) window.status = '●○○○○' + thetext + '○○○○●'


 

setTimeout("anim()", 200);

}


 

</script>

沒有留言: