-1

このカウントダウン スクリプト (JavaScript) をダウンロードしましたが、タイマーがカウントダウンする日付を変更する方法がわかりません。元のスクリプト:

$(function(){
var now = new Date();
// comment out the line below and change the date of your countdown here
var in30Days = new Date( now.getTime() + (30 * 24 * 60 * 60 * 1000) );
// year to countdown to
var countdownYear = in30Days.getFullYear();
// month to countdown to 0 = Jan, 1 = Feb, etc
var countdownMonth = in30Days.getMonth();
// day to countdown to
var countdownDay = in30Days.getDate();

var countdownDate = new Date( countdownYear, countdownMonth, countdownDay );

setupCountdownTimer( countdownDate );

spaceParallax();

hideIphoneBar();

$("[placeholder]").togglePlaceholder();

setupSignupForm();
});
4

2 に答える 2

0

おそらくcountdownDate...デフォルトでは、現在+ 30日で構築されていますか?これは変更できます。

重要な部分は次のとおりです。

setupCountdownTimer( countdownDate );

spaceParallax();

hideIphoneBar();

$("[placeholder]").togglePlaceholder();

setupSignupForm();
});
于 2013-07-31T08:38:35.187 に答える
0

あなたのコード自体がそれを行う方法を伝えています:

// comment out the line below and change the date of your countdown here
var in30Days = new Date( now.getTime() + (30 * 24 * 60 * 60 * 1000) );
// year to countdown to
var countdownYear = in30Days.getFullYear();
// month to countdown to 0 = Jan, 1 = Feb, etc
var countdownMonth = in30Days.getMonth();
// day to countdown to
var countdownDay = in30Days.getDate();

次の行はcountDownDateを作成し、年、月、日を関数に渡します

var countdownDate = new Date( countdownYear, countdownMonth, countdownDay );

setupCountdownTimer( countdownDate );
于 2013-07-31T08:42:18.557 に答える