村長fb!
此乃舊版魚蛋村,訪客請【按此到新版魚蛋村】繼續瀏覽
魚蛋村 yudans語法區語法範例 → 現在時間

現在時間

  • Internet Explorer 6.0
  • Internet Explorer 7.0
  • Internet Explorer 8.0
  • Mozilla Firefox 2.0
  • Mozilla Firefox 3.0
  • Google Chrome
  • Safari 3.1
  • Opera 9.5
  • 語法介紹 Introduction:
  • 現在時間 - 以跳字方式顯示時、分和秒。
  • 語法總長度:611 字元
  • 範例 Example:
  • 請將以下程式碼貼到<body>與</body>之間:
<script type="text/javascript"><!--
document.write("<span id=\"yudan_clock\"><\/span>");
var now,hours,minutes,seconds,timeValue;
function yudan_time(){
now = new Date();
hours = now.getHours();
minutes = now.getMinutes();
seconds = now.getSeconds();
timeValue = (hours >= 12) ? "下午 " : "上午 ";
timeValue += ((hours > 12) ? hours - 12 : hours) + " 時";
timeValue += ((minutes < 10) ? " 0" : " ") + minutes + " 分";
timeValue += ((seconds < 10) ? " 0" : " ") + seconds + " 秒";
document.getElementById("yudan_clock").innerHTML = timeValue;
setTimeout("yudan_time()",100);}
yudan_time();
// --></script>
  • 可修改的地方 Modify:
  • 可修改第 9 至 12 行的文字
魚蛋村,語法,圖片,素材,下載,琴譜,字型,教學,網頁製作,網頁教學,表情符號,程式,yudan,yudans,yudan village,javascript,cgi,php,msn,css,html,w3c,teach
footer