DonanımHaber Mini sürüm 2 Ocak 2026 tarihi itibariyle kullanımdan kalkacaktır. Bunun yerine daha hızlı bir deneyim için DH Android veya DH iOS uygulamalarını kullanabilirsiniz.
Arama butonu
Bu konudaki kullanıcılar: 1 misafir
0
Cevap
358
Tıklama
0
Öne Çıkarma
countup ve countdown (nerede yanlışım?)
O
9 yıl (46 mesaj)
Çavuş
Konu Sahibi

arkadaşlar elimde bir belirli bir günden ileri sayan bir sayaç var

onun altına da belirli bir güne geri sayım yapan bir sayaç eklemem lazım

javascript kodunu anladığım kadarı ile editliyorum ama olmuyor

*not: o kodu editlemem gerekmekte

 
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="donanım.ico" rel="icon" type="image/x-icon" />


<style>
#countup {margin: "center"}
#countup p {display: inline-block;padding: 0px;}
#countup p.hours,
#countup p.days,
#countup p.minutes,
#countup p.seconds
#countdown {margin: "center"}
#countdown p {display: inline-block;padding: 0px;}
#countdown p.saat,
#countdown p.gun,
#countdown p.dak,
#countdown p.san

</style>
</head>

<div id="countup">
<div align="center" style="font-style: oblique; color: #F916BF;">
"mevzu olalı
<p id="days">00</p>
<p class="timeRefDays">gün</p>
<p id="hours">00</p>
<p class="timeRefHours">saat</p>
<p id="minutes">00</p>
<p class="timeRefMinutes">dakika</p>
<p id="seconds">00</p>
<p class="timeRefSeconds">saniye</p> oldu."
</div>

<script>
window.onload=function uptime() {
// Month,Day,Year,Hour,Minute,Second
upTime('oct,03,2016,20:35:00'); // Bu satır değişecek!!
}
function upTime(countTo) {
now = new Date();
countTo = new Date(countTo);
difference = (now-countTo);

days=Math.floor(difference/(60*60*1000*24)*1);
hours=Math.floor((difference%(60*60*1000*24))/(60*60*1000)*1);
mins=Math.floor(((difference%(60*60*1000*24))%(60*60*1000))/(60*1000)*1);
secs=Math.floor((((difference%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1);

document.getElementById('days').firstChild.nodeValue = days;
document.getElementById('hours').firstChild.nodeValue = hours;
document.getElementById('minutes').firstChild.nodeValue = mins;
document.getElementById('seconds').firstChild.nodeValue = secs;

clearTimeout(upTime.to);
upTime.to=setTimeout(function uptime(){ upTime(countTo); },1000);
}
</script>



<div id="countdown">
<div align="center" style="font-style: oblique; color: #F916BF;">
"mevzunun olmasına
<p id="gun">00</p>
<p class="timeRefDays">gün</p>
<p id="saat">00</p>
<p class="timeRefHours">saat</p>
<p id="dak">00</p>
<p class="timeRefMinutes">dakika</p>
<p id="san">00</p>
<p class="timeRefSeconds">saniye</p> kaldı."
</div>
<script>
window.onload=function endtime() {
// Month,Day,Year,Hour,Minute,Second
upTime('oct,03,2017,20:35:00'); // Bu satır değişecek!!
}
function endtime() {
now = new Date();
countTo = new Date(countTo);
difference = (countTo-now);

days=Math.floor(difference/(60*60*1000*24)*1);
hours=Math.floor((difference%(60*60*1000*24))/(60*60*1000)*1);
mins=Math.floor(((difference%(60*60*1000*24))%(60*60*1000))/(60*1000)*1);
secs=Math.floor((((difference%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1);

document.getElementById('gun').firstChild.nodeValue = days;
document.getElementById('saat').firstChild.nodeValue = hours;
document.getElementById('dak').firstChild.nodeValue = mins;
document.getElementById('san').firstChild.nodeValue = secs;

clearTimeout(endTime.to);
endTime.to=setTimeout(function endtime(){ endTime(countTo); },1000);
}
</script>


Yardım edebilirseniz çok sevinirim





< Bu mesaj bu kişi tarafından değiştirildi oous -- 14 Ekim 2016; 3:07:23 >

DH Mobil uygulaması ile devam edin. Mobil tarayıcınız ile mümkün olanların yanı sıra, birçok yeni ve faydalı özelliğe erişin. Gizle ve güncelleme çıkana kadar tekrar gösterme.