SieuHoTro.Com
 
Home My Account Register Domain Transfer Domain Contact Us Whois Documentation
 
Forum Home Forum Home > Information Technology > The programming language > Java, Java script
  New Posts New Posts RSS Feed: show clock javascript
  FAQ FAQ  Forum Search   Register Register  Login Login
If this is your first visit, be sure to check out theForum by clicking the link above. You may have toregister before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
ASG Vietnam

show clock javascript

 Post Reply Post Reply
Author
guest View Drop Down
Guest
Guest
Avatar

Joined: 16 November 2007
Location: Vietnam
Online Status: Offline
Posts: 17
  Quote guest Quote  Post ReplyReply Direct Link To This Post Topic: show clock javascript
    Posted: 26 February 2008 at 15:33


     var myfont_face = "Arial";
     var myfont_size = "12";
     var myfont_color = "#0000cc";
     var myback_color = "#FFFFFF";
     var mywidth = 120;
     var my12_hour = 1;

     var dn = ""; var old = "";

     if (document.all||document.getElementById) { document.write('<span id="LiveClockIE" style="width:'+mywidth+'px; background-color:'+myback_color+'"></span>'); }
     else
     if (document.layers) { document.write('<ilayer bgColor="'+myback_color+'" id="ClockPosNS"><layer width="'+mywidth+'" id="LiveClockNS"></layer></ilayer>'); }
     else { old = "true"; show_clock(); }

     function show_clock() {

          //show clock in NS 4
          if (document.layers)
               document.ClockPosNS.visibility="show"
          if (old == "die") { return; }

          var Digital = new Date();
          var hours = Digital.getHours();
          var minutes = Digital.getMinutes();
          var seconds = Digital.getSeconds();

          if (my12_hour) {
               dn = "AM";
               if (hours > 12) { dn = "PM"; hours = hours - 12; }
               if (hours == 0) { hours = 12; }
          } else {
               dn = "";
          }
          if (minutes <= 9) { minutes = "0"+minutes; }
          if (seconds <= 9) { seconds = "0"+seconds; }

          myclock = '';
          myclock += '<strong> <font style="color:'+myfont_color+'; font-family:'+myfont_face+'; font-size:'+myfont_size+'pt;">';
          myclock += hours+':'+minutes+':'+seconds+' '+dn;
          myclock += '</font></strong> ';

          if (old == "true") {
               document.write(myclock);
               old = "die"; return;
          }

          if (document.layers) {
               clockpos = document.ClockPosNS;
               liveclock = clockpos.document.LiveClockNS;
               liveclock.document.write(myclock);
               liveclock.document.close();
          } else if (document.all) {
               LiveClockIE.innerHTML = myclock;
          } else if (document.getElementById) {
               document.getElementById("LiveClockIE").innerHTML = myclock;
          }

          setTimeout("show_clock()",1000);
}
  Share Topic     
Back to Top
guest View Drop Down
Guest
Guest
Avatar

Joined: 16 November 2007
Location: Vietnam
Online Status: Offline
Posts: 17
  Quote guest Quote  Post ReplyReply Direct Link To This Post Posted: 26 February 2008 at 15:34
<script language="javascript" src="liveclock_lite.js">
</script>
<script language="JavaScript">show_clock();</script>
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.047 seconds.
[Free Express Edition]
Copyright ©2001-2009 Web Wiz
Support: raovatphanmem Support: Info hanoi software
Online(s): 69.
Visitors Counter:36962357, AVERAGE/day(3439) is: 10748
Begin count is day 02/16/2009

You are browsing this site with: CCBot/2.0 (http://commoncrawl.org/faq/)
Your IP address is: 23.20.223.212
The DNS lookup of the IP address is: 23.20.223.212
The method used to call the page: GET
The server's domain name: sieuhotro.com
The link
BaoKyNam Viêm gan b Thẩm mỹ viện Hoa Kỳ