Thursday, June 3

Advanced Countdown & Countup widget

Ai nak share dengan korang satu widget untuk buat countdown kat sidebar..sangat simple dan nampak sangat profesional..Tak de gambar-gambar bagai..Memang nampak sangat kemas..Dan boleh count apa saja event tak kira la hari nikah ker,hari lahir ker,hari raya ker..Semua boleh..Dulu ai ada letak kat sidebar..tapi dah buang sebab nak letak apa yang patut je kat sidebar ai tu..
Korang cume perlu copy code kat bawah dan paste kat html (add gadget) kat sidebar korang.Sangat simple kan..Pastu korang tukar la teks ikut korangnya event.
/*
Untuk Countdown tarikh-tarikh penting
*/
//SILA TUKAR TEKS Hari Raya Aidilfitri mengikut kehendak anda cth:Besday Aku
//SILA TUKAR TEKS Selamat Hari Raya Aidilfitri mengikut kehendak anda cth:Hepi Besday kat Aku

<ul><li>
<script>
var before="Hari Raya Aidilfitri!"
var current="Selamat Hari Raya Aidilfitri!"
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
function countdown(yr,m,d){
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy
var futurestring=montharray[m-1]+" "+d+", "+yr
var difference=(Math.round((Date.parse(futurestring)-Date.parse(todaystring))/(24*60*60*1000))*1)
if (difference==0)
document.write(current)
else if (difference>0)
document.write("There are, "+difference+" days until "+before)
}
//SILA MASUKKAN TARIKH COUNT DOWM ANDA IKUT FORMAT year/month/day countdown(2010,09,10)
</script></li></ul>
<ul><li>
<script>
/*
Untuk CountUp tarikh-tarikh penting
*/
<ul><li>
<script>
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
function countup(yr,m,d){
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy
var paststring=montharray[m-1]+" "+d+", "+yr
var difference=(Math.round((Date.parse(todaystring)-Date.parse(paststring))/(24*60*60*1000))*1)
difference+=" days"
//SILA TUKAR TEKS We have been married for mengikut kehendak anda cth:Kami dah bersama selama
document.write("We have been married for "+difference+"!")
}
//SILA MASUKKAN TARIKH COUNT UP ANDA IKUT FORMAT year/month/day
countup(2002,01,22)
</script></li></ul>
P/S : i) Tolong tukar teks yang warna merah ikut korang punya date dan event
       ii) Countdown adalah untuk kira tarikh yang akan datang..(cth:lagi 55hari besday aku)
       iii) Countup untuk kira tarikh yang dah lepas ..(cth:aku dah kahwin selama 2345 hari)
       iv) Korang boleh ulang countdown & countup tu seberapa banyak yang korang nak
       v) Kalau nggak faham,nanti tinggal komen ya..

3 comments:

Ely Hasrul on June 3, 2010 at 10:30 AM said... [Reply]

bagusnye ..tengkiu ai..

Mama Farra dan Faris on June 3, 2010 at 7:59 PM said... [Reply]

tqvm...nak try

Anonymous said... [Reply]

tenks.. soklan cket yer..cmner nk wat link bar yg mcm kat bwah doa hari ini tu? email me plis... tenkiu very much... daiefisabilillah@yahoo.com

Post a Comment

 

Ratuhati Kami

  • Harith
  • Harith
  • Harith
  • Harith
  • Harith
  • Harith
  • Harith
  • Harith

Celebs Blog

Our Love Journal Copyright © 2010 Love Journal is Sponsored by HazlizaHusaini'sFamily