Tải bản đầy đủ (.doc) (9 trang)

Code đồng hồ lịch kèm lời chúc

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (153.5 KB, 9 trang )

Code đồng hồ lịch kèm lời chúc
<center><font face="Unicode" color="blue" size="4"><b><script type=
"text/javascript">

// Store the date In avarlable
d = new Date()
dateText = ""
// Get the cuurent day and convert it to the name of the day
dayValue = d.getDay()
if(dayValue == 0)
dateText += "Chủ Nhật"
else if (dayValue == 1)
dateText += "Thứ hai"
else if (dayValue == 2)
dateText += "Thứ Ba"
else if (dayValue == 3)
dateText += "Thứ Tư"
else if (dayValue == 4)
dateText += "Thứ Năm"
else if (dayValue == 5)
dateText += "Thứ Sáu"
else if (dayValue == 6)
dateText += "Thứ Bảy"
// Get the current date; if it's before 2000,add 1900
dateText += ", Ngày " + d.getDate()
// lấy tháng hiện tại và chuyển nó sang tháng theo tiếng Việt Nam
monthValue = d.getMonth()
dateText += " "
if (monthValue == 0)
dateText += "Tháng 1"
if (monthValue == 1)


dateText += "Tháng 2"
if (monthValue == 2)
dateText += "Tháng 3"
if (monthValue == 3)
dateText += "Tháng 4¬"
if (monthValue == 4)
dateText += "Tháng 5"
if (monthValue == 5)
dateText += "Tháng 6"
if (monthValue == 6)
dateText += "Tháng 7"
if (monthValue == 7)
dateText += "Tháng 8"
if (monthValue == 8)
dateText += "Tháng 9"
if (monthValue == 9)
dateText += "Tháng 10"
if (monthValue == 10)
dateText += "Tháng 11"
if (monthValue == 11)
dateText += "Tháng 12"
// Get the current year; if it's before 2000, add 1900
if (d.getYear() < 2000)
dateText += ", Năm " + (1900 + d.getYear())
else
dateText += ", Năm " + (d.getYear())
// Get the current minutes
minuteValue = d.getMinutes()
if (minuteValue < 10)
minuteValue = "0" + minuteValue

// Get the current hours
hourValue = d.getHours()
// Customize the greeting based on the current hours
if (hourValue >=5 && hourValue <= 10)
{

timeText = " Chào buổi sáng và chúc một ngày tốt lành"
}
else if (hourValue > 10 && hourValue <= 12)
{

timeText = " Chào buổi trưa - Bạn ăn cơm chưa vậy ?"
}
else if (hourValue >= 13 && hourValue <17)
{

timeText = " Chào buổi chiều "
}
else if (hourValue >=17 && hourValue <18)
{
timeText = " Chào buổi chiều - Chắc là bạn ăn cơm rồi nhỉ ?"
}
else if (hourValue >=18 && hourValue<21)
{

timeText = " Chào buổi tối"
}
else if( hourValue >=21 && hourValue <=24)
{
timeText = " ĐTN BLOG Chúc bạn ngủ ngon và có giấc mơ đẹp"

}
else if(hourValue >=1 && hourValue <5 )
{
timeText = "Bạn dậy sớm quá vậy?Hại sức khỏe lắm.Chúc một ngày vui vẻ"
}

// Write the greeting, the date, and the time to the page
document.write( dateText + "." + timeText + ".")
//
-->
</script></b></font></center>
* Code lịch đồng hồ cá cảnh (Thúy Quỳnh)
<embed src=" width ="176"
height ="220" quality="high" name="calendar" align="middle"
allowScriptAccess="sameDomain" type="application/x-shockwave-flash"
pluginspage=" />
Trần Thục Hiền @ 19:56 24/10/2009
Số lượt xem: 11
* Nhúng thắng cảnh Việt Nam vào trang riêng của bạn



×