語法展示::  http://home.graffiti.net/khfhfh44g/


請用IE6.0或更新版本觀看語法特效展示

將以下程式碼複製,貼在<body>及</body>標籤之間。

<center>
<form>
<input TYPE="button" VALUE="變化連結按鈕" NAME="goTo" onClick="window.goToUrl()">
</form>
</center>


將以下程式碼複製,貼在<head>及</head>標籤之間。

<script language="JavaScript">
<!--
var startTime   =null;
var timerID     =null;
var initial     =new Date();
var pos         =0;
var menuItem    =null;
function initArray() {
 this.length = initArray.arguments.length
   for (var i = 0; i < this.length; i++)      {
    this[i+1] = initArray.arguments[i]
   }
}
function parsemenuItem(data,num) {
 for(var i=0;i<data.length;i++)  {
  if(data.substring(i,i+1)=="|")  break;
   }
   if (num==0) return(data.substring(0,i));
   else  return(data.substring(i+1,data.length));
}
function startTimer() {
   initial = new Date();
   startTime=initial.getTime();
   stopTimer();
   menuItem = new initArray(
      "奇摩|http://tw.yahoo.com/",
      "雅虎|http://chinese.yahoo.com/",
      "蕃薯藤|http://www.yam.com/",
      "新浪網|http://www.sina.com.tw/",
      "PChome|http://www.pchome.com.tw/",
      "紫蓮の翼|http://blog.pixnet.net/como0925"   );
   showTimer();
}
function stopTimer() {
   timerID=null;
   menuItem=null;
   //clearTimeout(timerID);
}
function showTimer() {
 pos= (pos == menuItem.length) ? 1 : pos + 1;
 document.forms[0].elements[0].value=parsemenuItem(menuItem[pos],0);
   timerID=window.setTimeout('showTimer()',3000);
}
function goToUrl()  {
   //parent.welcome.location=parsemenuItem(menuItem[pos],1);
   this.location=parsemenuItem(menuItem[pos],1);
   return (false);
}
-->
</script>


自行增減連結的數量及路徑
timerID=window.setTimeout('showTimer()',3000); 中修改變化的速度(每1秒=1000)



將以下程式碼複製,貼在<body >標籤裡面。

 onload="window.startTimer()"

arrow
arrow
    全站熱搜

    紫蓮の翼 發表在 痞客邦 留言(0) 人氣()