我在聖誕節那天試圖使它變成「雪」時有點麻煩。我想出瞭如何抓住一天,但我不知道如何正確地調用SnowStorm()。在聖誕節當天致電一個功能
var christmas = {
month: 11,
date: 25
}
function isItChristmas() {
var now = new Date();
var isChristmas = (now.getMonth() == christmas.month && now.getDate() == christmas.date);
if (isChristmas)
return ;
else
return ;
}
var snowStorm = null;
function SnowStorm() {
(snowstorm code)
}
snowStorm = new SnowStorm();
哪一點是你卡在具體? 'isItChristmas'部分?如何將'snowStorm()'函數放入空的'if()'語句中?還有別的嗎? – Bojangles 2011-12-25 22:35:26