|
 |
|
การทำสีเวลา ช่วยหน่อยนะค่ะ ถ้าต้องทำสีเวลาน่ะค่ะจะต้องทำยัง เช่น เริ่มนับเวลา 1-2-3-4-5-6-7-8 เป็นสีเขียว |
|
 |
|
|
 |
 |
|
นี่เป็นสคริปเวลานับเพิ่มขึ้น
เอาตัววนี้เรียกใช้
Code (PHP)
<?php
<form><b>
คุณอยู่ในหน้านี้มานาน:
<input size=9 name=timespent>
</form></b>
<body onLoad="window.setTimeout('getSecs()',1)">
?>
พิมพ์เพิ่ม html นะค่ะ
|
 |
 |
 |
 |
Date :
2009-07-23 17:57:33 |
By :
krataiss |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตามนี้ครับ
ลอง ใช้คำสั่ง if นับจำนวนค่าดู

Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-11" />
<meta name="author" content="Marosdee" />
<script>
startday = new Date();
clockStart = startday.getTime();
function initStopwatch()
{
var myTime = new Date();
var timeNow = myTime.getTime();
var timeDiff = timeNow - clockStart;
this.diffSecs = timeDiff/1000;
return(this.diffSecs);
}
function getSecs()
{
var mySecs = initStopwatch();
var mySecs1 = ""+mySecs;
mySecs1 = parseInt(mySecs1.substring(0,mySecs1.indexOf(".")));
mySecs2 = mySecs1 + " วินาที";
if ( mySecs1 < 9 )
{
mySecs2 = '<font color=green>' + mySecs2 + '</font>';
}
else if ( mySecs1 < 14 )
{
mySecs2 = '<font color=orange>' + mySecs2 + '</font>';
}
else
{
mySecs2 = '<font color=red>' + mySecs2 + '</font>';
}
document.getElementById('timespent').innerHTML = mySecs2
window.setTimeout('getSecs()',1000);
}
window.onload = setTimeout('getSecs()',1);
</script>
<title>Stop Watch</title>
</head>
<body>
<b>
คุณอยู่ในหน้านี้มานาน:
<span id='timespent' >กรุณาเปิด Javascript</span>
</b>
</body>
</html>
|
 |
 |
 |
 |
Date :
2009-07-23 18:15:35 |
By :
danya |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
สคริปของเพ่ ดุนยา นี้เจ๋งจริงๆ 555
|
 |
 |
 |
 |
Date :
2009-07-23 20:41:40 |
By :
somparn |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอพระคุณอย่างยิ่งค่ะ
|
 |
 |
 |
 |
Date :
2009-07-23 20:51:02 |
By :
krataiss |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ว่าแต่ว่ามัน synchro นะครับ 
|
 |
 |
 |
 |
Date :
2009-07-23 21:05:48 |
By :
pjgunner |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ยังไงล่ะค่ะ
|
 |
 |
 |
 |
Date :
2009-07-24 10:12:56 |
By :
krataiss |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|