Contagem Regressiva - HTML/JavaScript - Urgente

24/10/2019

0

<HTML>
<HEAD>
 <title>Exemplo</title>
		<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
		<style type=text/css>
			body{background-image: url(https://images.squarespace-cdn.com/content/v1/56eb100059827e8e902a4dc8/1514915973077-KWLG8LATY32VQYH4HNK2/ke17ZwdGBToddI8pDm48kPTrHXgsMrSIMwe6YW3w1AZ7gQa3H78H3Y0txjaiv_0fDoOvxcdMmMKkDsyUqMSsMWxHk725yiiHCCLfrh8O1z4YTzHvnKhyp6Da-NYroOW3ZGjoBKy3azqku80C789l0k5fwC0WRNFJBIXiBeNI5fKTrY37saURwPBw8fO2esROAxn-RKSrlQamlL27g22X2A/Bg-2.jpg);
				background-repeat: round;
				}
			.countdownContainer{
				position: absolute;; 
				top:50%;
				left:25%;
				transform : translateX(-50%) tralateY(-50%);
				text-align:center;
				background: #f5f5f5;
				border: 1px solid #999;
				padding: 8px;
				box-shadow: 0 0 5px 3px #ccc;
				}
			.info{
				font-family: Arial;
				font-size: 80px;
			}
			.sub{
				font-family: Arial;
				font-size: 20px;
			}
			.info2{
				font-family: Arial;
				font-size: 75px;
			}
		</style>
</HEAD>
<BODY>
  <script language="JavaScript1.2">
  var aa = 2019
  var mm = 10
  var dd = 26
  var hh = 19
  var mi = 30
   
function setcountdown(theyear,themonth,theday,hour,minutes) {
yr=theyear;mo=themonth;da=theday; h=hour; m=minutes
} setcountdown(aa,mm,dd,hh,mm)
 
 
var occasion="exemplo"
var message_on_occasion="Ja Vai Começar!!"
 
 
var countdownwidth=''
var countdownheight=''
var countdownbgcolor=''
var opentags=''
var closetags=''
 
 
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
var crosscount=''
 
function start_countdown(){
if (document.layers)
document.countdownnsmain.visibility="show"
else if (document.all||document.getElementById)
crosscount=document.getElementById&&!document.all?document.getElementById("countdownie") : countdownie
countdown()
}
 
if (document.all||document.getElementById)
document.write('<span id="countdownie" style="width:'+countdownwidth+'; background-color:'+countdownbgcolor+'"></span>')
 
window.onload=start_countdown
 
 
function countdown(){
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[mo-1]+" "+da+", "+yr+" "+h+":"+m
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
//if on day of occasion
if(dday<=0&&dhour<=0&&dmin<=0&&dsec<=1&&todayd==da){
if (document.layers){
document.countdownnsmain.document.countdownnssub.document.write (opentags+"Ja Vai Começar!!"+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
document.getElementById("crosscount").textContent=opentags+"Ja Vai Começar!!"+closetags
return
}
//if passed day of occasion
else if (dday<=-1){
if (document.layers){
document.countdownnsmain.document.countdownnssub.document.write(opentags+"Já Vai Começar!!"+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
document.getElementById("crosscount").textContent=opentags+"Já Vai Começar!!"+closetags
return
}
//else, if not yet
else{
if (document.layers){
document.countdownnsmain.document.countdownnssub.document.write(opentags+dmin+":"+dsec+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
document.getElementById("crosscount").textContent=opentags+dmin+":"+dsec+closetags
}
setTimeout("countdown()",1000)
}
</script>
<table class="countdownContainer">
			<tr class="info2">
			<td colspan="4">Contagem Regressiva exemplo</td>
			</tr>
			<tr class="info">
				<div id="crosscount"></div>
							</tr>
			<tr class="sub">
				<td>Minutos</td>
				<td>Segundos</td>
			</tr>
		</table>
</BODY>
</HTML>

Ok este é código que eu preciso para sábado(26.10.2019), preciso fazer um contador para utilizar no evento, ele tem fundo e tem o código praticamente pronto como posso fazer para que ele apareça tipo assim:
<!DOCTYPE html>
<html>
	<head>
		<title>Exemplo</title>
		<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
		<style type=text/css>
			body{background-image: url(https://images.squarespace-cdn.com/content/v1/56eb100059827e8e902a4dc8/1514915973077-KWLG8LATY32VQYH4HNK2/ke17ZwdGBToddI8pDm48kPTrHXgsMrSIMwe6YW3w1AZ7gQa3H78H3Y0txjaiv_0fDoOvxcdMmMKkDsyUqMSsMWxHk725yiiHCCLfrh8O1z4YTzHvnKhyp6Da-NYroOW3ZGjoBKy3azqku80C789l0k5fwC0WRNFJBIXiBeNI5fKTrY37saURwPBw8fO2esROAxn-RKSrlQamlL27g22X2A/Bg-2.jpg);
				background-repeat: round;
				}
			.countdownContainer{
				position: absolute;; 
				top:50%;
				left:25%;
				transform : translateX(-50%) tralateY(-50%);
				text-align:center;
				background: #f5f5f5;
				border: 1px solid #999;
				padding: 8px;
				box-shadow: 0 0 5px 3px #ccc;
				}
			.info{
				font-family: Arial;
				font-size: 80px;
			}
			.sub{
				font-family: Arial;
				font-size: 20px;
			}
		</style>
		</head>
	<body>  
		<table class="countdownContainer">
			<tr class="info">
			<td colspan="4" class="info">Contagem Regressiva Exemplo</td>
			</tr>
			<tr class="info">
				<div id="minutes">45</div>
				<div id="seconds">00</div>
							</tr>
			<tr class="sub">
				<td>Minutos</td>
				<td>Segundos</td>
			</tr>
		</table>
	</body>
</html>
Pedro Silva

Pedro Silva

Responder

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar