2014-05-05 49 views
0

嗨,我只是想知道如何自動設置我的倒計時日期爲當前DAT,這是腳本:如何設置我的倒計時腳本的當前日期?

<script> 


jQuery(document).ready(function() { 


    function callback() { 
     alert("finish"); 
    } 
    $("#flipit").coffeetime({ 
     /* COUNTDOWN SETTINGS */ 
     message: message, // the message array with the array keys as percent values 
     startYear: 2013, 
     startMonth: 8, 
     startDay: 1, 
     endYear: 2015, 
     endMonth: 0, 
     endDay: 0, 
     soundControlCssClass: 'icon sound margin-top-20 body-google-font', 
     messageBoxId: "percent-message", 
     callbackFinish: callback, 
    }); 


    $(".flip-title-subheading").html("was created in: " + new Date() + " and we`ll finish after: " + window.endDate); 

}); 
jQuery(document).ready(function() { 
    setTimeout(function() { 
     $(".flip-container").animate({ 
      "height": 105 + "px" 
     }, 1000, "swing"); 
    }, 1000); 
}); 

我想知道如何設置startYear,startMonth,朝九特派請自動在當前日期。

回答

0
jQuery(document).ready(function() { 


    function callback() { 
     alert("finish"); 
    } 
    var dt = new Date(); 
    $("#flipit").coffeetime({ 
     /* COUNTDOWN SETTINGS */ 
     message: message, // the message array with the array keys as percent values 
     startYear: dt.getFullYear(), 
     startMonth: dt.getMonth() + 1, 
     startDay: dt.getDate(), 
     endYear: 2015, 
     endMonth: 0, 
     endDay: 0, 
     soundControlCssClass: 'icon sound margin-top-20 body-google-font', 
     messageBoxId: "percent-message", 
     callbackFinish: callback, 
    }); 


    $(".flip-title-subheading").html("was created in: " + new Date() + " and we`ll finish after: " + window.endDate); 

}); 
jQuery(document).ready(function() { 
    setTimeout(function() { 
     $(".flip-container").animate({ 
      "height": 105 + "px" 
     }, 1000, "swing"); 
    }, 1000); 
}); 
+1

我不知道該如何謝謝,單詞不夠多謝,非常感謝! – mogogogo

+0

非常歡迎! –