For making the advent calender you will need to open and close the doors of the advent calender. So I thought providing the code for that would be useful to you. The code mentioned below in JavaScript will help you to open and close the advent calender doors :
Code:
function open_door (day) {
if (day == current_day()) {
var door = document.getElementById("door" + day);
door.style.visibility = "hidden";
var present = document.getElementById("present" + day);
present.style.visibility = "visible";
}
}
function close_door (day) {
if (day == current_day()) {
var door = document.getElementById("door" + day);
door.style.visibility = "visible";
var present = document.getElementById("present" + day);
present.style.visibility = "hidden";
}
Bookmarks