Meteorológia
  • Dave92
    #5
    <!-- THREE STEPS TO INSTALL DATE COUNTDOWN:

    1. Paste the first into the HEAD of your HTML document
    2. Code the OnLoad event handler into the BODY tag
    3. Add the last code into the BODY of your HTML document -->

    <!-- STEP ONE: Copy this code into the HEAD of your HTML document -->

    <HEAD>

    <SCRIPT LANGUAGE="JavaScript">

    <!-- Begin
    var Temp2;
    var timerID = null;
    var timerRunning = false;
    function arry() {
    this.length = 12;
    this[0] = 31;
    this[1] = 28;
    this[2] = 31;
    this[3] = 30;
    this[4] = 31;
    this[5] = 30;
    this[6] = 31;
    this[7] = 31;
    this[8] = 30;
    this[9] = 31;
    this[10] = 30;
    this[11] = 31;
    }
    var date = new arry();

    function stopclock() {
    if(timerRunning)
    clearTimeout(timerID);
    timerRunning = false;
    }

    function startclock() {
    stopclock();
    showtime();
    }

    function showtime() {
    now = new Date();
    var CurMonth = now.getMonth();
    var CurDate = now.getDate();
    var CurYear = now.getFullYear();
    now = null;
    if (21 < CurDate) {
    CurDate -= date[CurMonth]; CurMonth++;
    }
    if (2 < CurMonth) {
    CurMonth -= 12; CurYear++;
    }

    var Yearleft = 2006 - CurYear;
    var Monthleft = 2 - CurMonth;
    var Dateleft = 21 - CurDate;

    document.dateform.a.value = Yearleft;
    document.dateform.b.value = Monthleft;
    document.dateform.c.value = Dateleft;

    timerID = setTimeout("showtime()",1000);
    timerRunning = true;
    }
    // End -->
    </script>
    </HEAD>

    <!-- STEP TWO: Add the OnLoad event handler to the BODY tag -->

    <BODY Onload="startclock()">

    <!-- STEP THREE: Insert this code into the BODY of your HTML document -->

    <form name=dateform>Még
    <input type=text name=a size=2 value=""> év,
    <input type=text name=b size=2 value=""> hónap, és
    <input type=text name=c size=2 value=""> nap van hátra eddig:3/21/2006</form>

    <!-- Script Size: 1.95 KB -->