H2A_Code tạo đồng hồ có lịch kèm lời chúc

5 296 0
Tài liệu đã được kiểm tra trùng lặp
H2A_Code tạo đồng hồ có lịch kèm lời chúc

Đang tải... (xem toàn văn)

Thông tin tài liệu

Website: http://violet.vn/thanhha03vl H2A_Code tạo đồng hồ lịch kèm lời chúc <script language="JavaScript" type="text/javascript"> <!-- Begin day = new Date(); miVisit = day.getTime(); function clock() { dayTwo = new Date(); hrNow = dayTwo.getHours(); mnNow = dayTwo.getMinutes(); scNow = dayTwo.getSeconds(); miNow = dayTwo.getTime(); if (hrNow == 0) { hour = 12; ap = " AM"; } else if(hrNow <= 11) { ap = " AM"; hour = hrNow; } else if(hrNow == 12) { ap = " PM"; hour = 12; } else if (hrNow >= 13) { hour = (hrNow - 12); ap = " PM"; } if (hrNow >= 13) { hour = hrNow - 12; } if (mnNow <= 9) { min = "0" + mnNow; } else (min = mnNow) if (scNow <= 9) { secs = "0" + scNow; } else { secs = scNow; } time = hour + ":" + min + ":" + secs + ap; document.form.button.value = time; self.status = time; Chia sÎ kinh nghiÖm t¹o Website Violet 1 NguyÔn ThÞ Thanh Hµ Email: thanhhha03vl@gmail.com Website: http://violet.vn/thanhha03vl setTimeout('clock()', 1000); } function timeInfo() { milliSince = miNow; milliNow = miNow - miVisit; secsVisit = Math.round(milliNow / 1000); minsVisit = Math.round((milliNow / 1000) / 60); alert("There have been " + milliSince + " milliseconds since midnight, January 1, 1970. " + "You have spent " + milliNow + " of those milliseconds on this page. " + " About " + minsVisit + " minutes, and " + secsVisit + " seconds."); } document.write("<center><form name=\"form\">" + "<input type=button value=\"Click for info!\"" + " name=button onClick=\"timeInfo()\"><\/form><\/center>"); onError = null; clock(); // End --> </script><center><font face="Unicode" color="blue" size="2"><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" Chia sÎ kinh nghiÖm t¹o Website Violet 2 NguyÔn ThÞ Thanh Hµ Email: thanhhha03vl@gmail.com Website: http://violet.vn/thanhha03vl // 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 Chia sÎ kinh nghiÖm t¹o Website Violet 3 NguyÔn ThÞ Thanh Hµ Email: thanhhha03vl@gmail.com Website: http://violet.vn/thanhha03vl 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 = " Thanh Hà chúc bạn ngủ ngon và 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 + ".") //http://thantoc.blogspot.com --> </script></b></font></center> <br> <center>Để tạo sự kết nối, trao đổi kinh nghiệm giảng dạy, chia sẻ tài liệu và học hỏi lẫn nhau. Chia sÎ kinh nghiÖm t¹o Website Violet 4 NguyÔn ThÞ Thanh Hµ Email: thanhhha03vl@gmail.com Website: http://violet.vn/thanhha03vl Kính mời quý thầy cùng đóng góp ý kiến và chia sẻ tài liệu cùng Thanh Hà. Xin cảm ơn!<br></center> Chia sÎ kinh nghiÖm t¹o Website Violet 5 NguyÔn ThÞ Thanh Hµ Email: thanhhha03vl@gmail.com . Website: http://violet.vn/thanhha03vl H2A_ Code tạo đồng hồ có lịch kèm lời chúc <script language="JavaScript" type="text/javascript">. >=21 && hourValue <=24) { timeText = " Thanh Hà chúc bạn ngủ ngon và có giấc mơ đẹp" } else if(hourValue >=1 && hourValue

Ngày đăng: 10/10/2013, 08:11

Tài liệu cùng người dùng

Tài liệu liên quan