Status bar rolling time

Source: Internet
Author: User
Tip: you can modify some code before running

<html><head><title>Status bar rolling time</title></head><body>Please refer to the status bar<BR><!--将以下代码加入HTML的<Body></body>之间--><SCRIPT language=JavaScript>Var osd = "" osd + = ""; var timer; var msg = ""; function scrollMaster () {msg = customDateSpring (new Date () clearTimeout (timer) msg + = "" + showtime () + "" + osdfor (var I = 0; I <100; I ++) {msg = "" + msg ;} scrollMe ()} function scrollMe () {window. status = msg; msg = msg. substring (1, msg. length) + msg. substring (200); timer = setTimeout ("scrollMe ()",);} function showtime () {var now = new Date (); var hour S = now. getHours (); var minutes = now. getMinutes (); var seconds = now. getSeconds (); var months = now. getMonth (); var dates = now. getDate (); var years = now. getYear (); var timeValue = "" timeValue + = (months> 9 )? "": "") TimeValue + = (dates> 9 )? "": "") TimeValue = (months + 1) timeValue + = "/" + datestimeValue + = "/" + yearsvar ap = ". m. "if (hours = 12) {ap =" P. m. "} if (hours = 0) {hours = 12} if (hours> = 13) {hours-= 12; ap =" P. m. "} var timeValue2 =" "+ hourstimeValue2 + = (minutes <10 )? ": 0": ":") + minutes + "" + apreturn timeValue2;} function MakeArray (n) {this. length = nreturn this} monthNames = new MakeArray (12) monthNames [1] = "June January" monthNames [2] = "June February" monthNames [3] = "June March" monthNames [4] = "June April" monthNames [5] = "June May" monthNames [6] = "June" monthNames [7] = "July" monthNames [8] = "August" monthNames [9] = "September" monthNames [10] = "October" monthNames [11] = "November" monthNames [12] = "December" daysNames = new MakeArray (7) daysNames [1] = "Sunday" daysNames [2] = "Monday" daysNames [3] = "Tuesday" daysNames [4] = "Wednesday" daysNames [5] = "Thursday" daysNames [6] = "Friday" daysNames [7] = "Saturday" function customDateSpring (oneDate) {var theDay = daysNames [oneDate. getDay () + 1] var theDate = oneDate. getDate () var theMonth = monthNames [oneDate. getMonth () + 1] var dayth = "no." if (theDate = 1) | (theDate = 21) | (theDate = 31 )) {dayth = "st";} if (theDate = 2) | (theDate = 22) {dayth = "nd ";} if (theDate = 3) | (theDate = 23) {dayth = "rd";} return theDay + ", "+ theMonth +" "+ theDate + dayth +", "} scrollMaster ();</sCRIPT></body></html>
Tip: you can modify some code before running

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.