Diễn đàn Trái Tim Yên Bái 2024

 Quên mật khẩu
 Đăng ký
Xem: 1523|Trả lời: 4
Thu gọn cột thông tin

[Hỏi đáp] Code đếm ngược

[Lấy địa chỉ]

Viết tâm trạng

Đăng lúc 26-4-2009 02:15 PM | Xem tất |Chế độ đọc

Mời bạn đăng ký để giao lưu kết bạn nhé <3

Bạn phải đăng nhập để xem được nội dung, nếu bạn chưa có tài khoản? hãy Đăng ký

x
Ở 1 số forum em thấy có code đếm ngược thời gian:
VD Còn 5 ngày 46 phút 32 giây là đến Năm mới
Làm sao làm đc thế ạ, bỏ vào forum ntn?
  • Tâm trạng hàng ngày
    Hạnh phúc
    2-7-2025 09:43 PM
  • Đã viết: 13 ngày

    [LV.3]Spam 3

    Đăng lúc 26-4-2009 02:20 PM | Xem tất
    chảl iên quan gì đến dz cả

    1. function setcountdown(theyear,themonth,theday){
    2. yr=theyear;mo=themonth;da=theday
    3. }
    4. //////////CONFIGURE THE COUNTDOWN SCRIPT HERE//////////////////
    5. //STEP 1: Configure the countdown-to date, in the format year, month, day:
    6. setcountdown(2008,02,07)
    7. //STEP 2: Change the two text below to reflect the occasion, and message to display on that occasion, respectively
    8. var occasion="XUÂN MẬU TÝ 2008"
    9. var message_on_occasion="KTCN Chúc Bạn Và Gia Đình Một Năm Mới Tràn Đầy Hạnh Phúc!"
    10. //STEP 3: Configure the below 5 variables to set the width, height, background color, and text style of the countdown area
    11. var countdownwidth='600px'
    12. var countdownheight='40px'
    13. var countdownbgcolor=''
    14. var opentags=''
    15. var closetags=''
    16. //////////DO NOT EDIT PASS THIS LINE//////////////////
    17. var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
    18. var crosscount=''
    19. function start_countdown(){
    20. if (document.layers)
    21. document.countdownnsmain.visibility="show"
    22. else if (document.all||document.getElementById)
    23. crosscount=document.getElementById&&!document.all?document.getElementById("countdownie") : countdownie
    24. countdown()
    25. }
    26. if (document.all||document.getElementById)
    27. document.write('')
    28. window.onload=start_countdown

    29. function countdown(){
    30. var today=new Date()
    31. var todayy=today.getYear()
    32. if (todayy < 1000)
    33. todayy+=1900
    34. var todaym=today.getMonth()
    35. var todayd=today.getDate()
    36. var todayh=today.getHours()
    37. var todaymin=today.getMinutes()
    38. var todaysec=today.getSeconds()
    39. var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
    40. futurestring=montharray[mo-1]+" "+da+", "+yr
    41. dd=Date.parse(futurestring)-Date.parse(todaystring)
    42. dday=Math.floor(dd/(60*60*1000*24)*1)
    43. dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
    44. dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
    45. dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
    46. //if on day of occasion
    47. if(dday<=0&&dhour<=0&&dmin<=0&&dsec<=1&&todayd==da){
    48. if (document.layers){
    49. document.countdownnsmain.document.countdownnssub.document.write(opentags+message_on_occasion+closetags)
    50. document.countdownnsmain.document.countdownnssub.document.close()
    51. }
    52. else if (document.all||document.getElementById)
    53. crosscount.innerHTML=opentags+message_on_occasion+closetags
    54. return
    55. }
    56. //if passed day of occasion
    57. else if (dday<=-1){
    58. if (document.layers){
    59. document.countdownnsmain.document.countdownnssub.document.write(opentags+"Occasion already passed! "+closetags)
    60. document.countdownnsmain.document.countdownnssub.document.close()
    61. }
    62. else if (document.all||document.getElementById)
    63. crosscount.innerHTML=opentags+"Occasion already passed! "+closetags
    64. return
    65. }
    66. //else, if not yet
    67. else{
    68. if (document.layers){
    69. document.countdownnsmain.document.countdownnssub.document.write(opentags+"Còn, "+dday+ " ngày, "+dhour+" giờ, "+dmin+" phút, và "+dsec+" giây nữa là đến "+occasion+closetags)
    70. document.countdownnsmain.document.countdownnssub.document.close()
    71. }
    72. else if (document.all||document.getElementById)
    73. crosscount.innerHTML=opentags+"Chỉ còn: "+dday+ " ngày, "+dhour+" giờ, "+dmin+" phút, và "+dsec+" giây nữa là đến "+occasion+closetags
    74. }
    75. setTimeout("countdown()",1000)
    76. }
    Sao chép mã
     Tác giả| Đăng lúc 26-4-2009 03:35 PM | Xem tất
    Code này cho vào đâu vậy anh SK
  • Tâm trạng hàng ngày
    Hạnh phúc
    2-7-2025 09:43 PM
  • Đã viết: 13 ngày

    [LV.3]Spam 3

    Đăng lúc 26-4-2009 07:03 PM | Xem tất
    cho vào đâu muốn hiêhnj ấy
    dùng ngay chức năng Adv quảng cáo mà chèn dạng mã html là hiện
     Tác giả| Đăng lúc 27-4-2009 09:29 AM | Xem tất
    Anh chỉ dẫn kỉ hơn giùm em đc hông ạ, em dốt mấy cái này lắm ^^
    Bạn phải đăng nhập mới được đăng bài Đăng nhập | Đăng ký

    Quy tắc điểm

    Đóng

    Thông báoTrước /1 Sau

    Phòng tối|Lưu trữ|Diễn đàn Yên Bái 2024 Community Guidelines |

    GMT+7, 6-12-2026 06:13 PM , Processed in 0.021265 second(s), 22 queries .

    Powered by Discuz! X3.4

    © 2001-2013 Comsenz Inc.

    Trả lời nhanh Lên trên Trở lại danh sách