• 0
Sign in to follow this  
Dezinh0

Contagem

Question

Presciso de um script de contagem regressiva.. tipo " Faltam xx dias xx minutos e xx segundos para dia xx "

c alguém souber ond tem... postae

grato desde já :P

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

CLIQUE AQUI

ae, pra quem for tentar algo olha esse link............

tem q alterar um poco o cod. mas eu ainda num consegui

Share this post


Link to post
Share on other sites
  • 0

Dezinho.. pega ai.. se foi mal atendido.. por favor reclame com os Administradores do Forum..

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
    <TITLE>Calendrio regressivo  Autor : [email protected] - Desenvolvimento de Sistemas</TITLE>
</HEAD>

<BODY TEXT="black" BGCOLOR="#99CCFF" LINK="#0000FF" VLINK="#0000FF" onLoad="startclock()">

<P><script language="JavaScript">
<!-- 
var timerID = null;
var timerRunning = false;
function stopclock (){
        if(timerRunning)
                clearTimeout(timerID);
        timerRunning = false;
}

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


function showtime () {
        var now = new Date();
        var hours = now.getHours();
        var minutes = now.getMinutes();
        var seconds = now.getSeconds();
        var date = now.getDate();
        var month = now.getMonth() + 1;
        var year = now.getYear();
        var timeValue = "" + ((hours < 10 ) ? "0" : "") + hours
        // var timeValue = "" + ((hours >12) ? hours -12 :hours)
        timeValue += ((minutes < 10) ? ":0" : ":") + minutes
        timeValue += ((seconds < 10) ? ":0" : ":") + seconds
        // timeValue += (hours >= 12) ? " P.M." : " A.M."

         if (seconds == 0) {
    window.status = "Novo minuto!";
    document.clock.face.value = "Novo minuto!";
         }
        if (minutes == 0 && seconds == 0) {
    window.status = "Nova hora!";
    document.clock.face.value = "Nova hora!";
    
         }
        if (hours == 0 && minutes == 0 && seconds == 0) {
    window.status = "Noite!";
    document.clock.face.value = "Noite!";
         }

       else if (seconds > 0) {
    document.clock.face.value = timeValue + "  " + date + "/" +  month + "/" + year;    
    window.status = timeValue + "  O relógio está cincronizado com o relógio de seu computador!     "  + date + "/" + month + "/" + year;
                }

        nextXmas = new Date("December 25, 2003")
        nextXmas.setYear(now.getYear())
        msPerDay = 24 * 60 * 60 * 1000; // Numeros de milisegundos por dia 
        daysLeft = (nextXmas.getTime() - now.getTime()) / msPerDay;
        daysLeft = Math.round(daysLeft);
        document.Frame2.Xmas.value =  daysLeft + " dias úteis para o Natal!";
        
        nextXmas = new Date("December 31, 2003")
        nextXmas.setYear(now.getYear())
        msPerDay = 24 * 60 * 60 * 1000; 
        daysLeft = (nextXmas.getTime() - now.getTime()) / msPerDay;
        daysLeft = Math.round(daysLeft);
        document.Frame3.NewYear.value = daysLeft + " dias úteis para o Ano Novo!";
                    
        nextXmas = new Date("September 7, 2004")
        msPerDay = 24 * 60 * 60 * 1000; 
        daysLeft = (nextXmas.getTime() - now.getTime()) / msPerDay;
        daysLeft = Math.round(daysLeft);
        document.Frame4.Niver.value =  daysLeft + " dias para comemoração de 7 de Setembro";

        nextXmas = new Date("October 12, 2004")
        msPerDay = 24 * 60 * 60 * 1000; 
        daysLeft = (nextXmas.getTime() - now.getTime()) / msPerDay;
        daysLeft = Math.round(daysLeft);
        document.Frame5.Oktober.value =  daysLeft + " dias para o Dia das Crianças"

        
        timerID = setTimeout("showtime()",1000);
        timerRunning = true;
}
// -->
</SCRIPT></P>
<P ALIGN="CENTER"><B><FONT SIZE="5" COLOR="red" FACE="Times New Roman">
Calendário</FONT></B></P>
<P>
<CENTER>
<P>
<TABLE BORDER="0" WIDTH="477" HEIGHT="280" BGCOLOR="#FFCC00">
    <TR>
  <TD BGCOLOR="#0066FF">
      <P ALIGN="CENTER"><FORM METHOD="POST" ENCTYPE="application/x-www-form-urlencoded" name="clock" onSubmit="0"> <B>
              <FONT
      SIZE="2" FACE="Verdana">Data e hor&aacute;rio</FONT></B><font face="Verdana"><font size="2"><BR>
     </font>
      <input type="textarea" name="face" size=20 value="Java"></font></P>

      <P ALIGN="CENTER">      </FORM>
<FORM METHOD="POST" ENCTYPE="application/x-www-form-urlencoded" name="Frame2" onSubmit="0"> <B>
  <FONT SIZE="2"
      FACE="Verdana">Faltam</FONT></B><font face="Verdana"><font size="2"><BR>
      </font>
      <input type="textarea" name="Xmas" size=50 value="Java"><font size="2">
  </font></font>    </FORM>
<FORM METHOD="POST" ENCTYPE="application/x-www-form-urlencoded" name="Frame3" onSubmit="0"> 
  <font face="Verdana"> <input type="textarea" name="NewYear" size=50 value="JavaScript"><font size="2">
  </font></font>
      </FORM>
<FORM METHOD="POST" ENCTYPE="application/x-www-form-urlencoded" name="Frame4" onSubmit="0"> 
  <font face="Verdana"> <input type="textarea" name="Niver" size=50 value="JavaScript"><font size="2">
  </font></font>
      </FORM>
<FORM METHOD="POST" ENCTYPE="application/x-www-form-urlencoded" name="Frame5" onSubmit="0"> 
  <font face="Verdana"> <input type="textarea" name="Oktober" size=50 value="JavaScript"><font size="2">
  </font></font>
  </TD>
    </TR>
</TABLE>
</P>
</CENTER>
<SPAN STYLE="Position : Relative; Left : 0px; Top : 0px; Width : 150px; Height : 160px">
<P ALIGN="CENTER">
    <P>
    <CENTER>
<p></p>
</CENTER>
    <P>
</SPAN>
<P>
</FORM>

</BODY>

</HTML>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this