Брояч

chaser

Registered
Някой ще ми каже ли как да си направя брояч да отброява колко часове остават до някакво събитие да обратно броене
 
http://web-tourist.net/login/login/view.php?st=1522

По-добре си вземи кода от source-a на демото:

http://thecitygardens.hit.bg/index.html

Защото кода дето са дали , нещо не работи.
Ето ти го направо от демото:

<html>
<head>
<meta http-equiv="content-type" content="text/html; windows=1251">
</head>

<style type="text/css">
.ws6 {font-size: 8px;}
.ws7 {font-size: 9.3px;}
.ws8 {font-size: 11px;}
.ws9 {font-size: 12px;}
.ws10 {font-size: 13px;}
.ws11 {font-size: 15px;}
.ws12 {font-size: 16px;}
.ws14 {font-size: 19px;}
.ws16 {font-size: 21px;}
.ws18 {font-size: 24px;}
.ws20 {font-size: 27px;}
.ws22 {font-size: 29px;}
.ws24 {font-size: 32px;}
.ws26 {font-size: 35px;}
.ws28 {font-size: 37px;}
.ws36 {font-size: 48px;}
.ws48 {font-size: 64px;}
.ws72 {font-size: 96px;}
.wpmd {font-size: 13px;font-family: 'Arial';font-style: normal;font-weight: normal;text-decoration: none;}
</style>


<body>

<div id="html1" style="position:absolute; overflow:hidden; left:0px; top:0px; width:730px; height:71px; z-index:0">
<form name="count">
<input type="text" size="75" name="count2">
</form>


<script>


var before="Нещоси!"
var current="Това е текста който ще ви покаже след отброяването!"
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")

function countdown(yr,m,d){
theyear=yr;themonth=m;theday=d
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[m-1]+" "+d+", "+yr
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(dday==0&&dhour==0&&dmin==0&&dsec==1){
document.forms.count.count2.value=current
return
}
else
document.forms.count.count2.value="Остават "+dday+ " дни, "+dhour+" часа, "+dmin+" минути, and "+dsec+" секунди остават до "+before
setTimeout("countdown(theyear,themonth,theday)",1000)
}
countdown(2007,12,25)
</script>


</body>
</html>

Само си настрой датата до която да отброява.

countdown(2007,12,25)

година
месец
дата
 

Back
Горе