"past, present and future classes on step elements"

This commit is contained in:
Bartek Szopka
2012-03-10 23:06:48 +00:00
parent b0a139ef81
commit b23506e885
2 changed files with 28 additions and 20 deletions

View File

@@ -424,6 +424,21 @@
return stepTo(next);
};
// STEP CLASSES
steps.forEach(function (step) {
step.classList.add("future");
});
document.addEventListener("impressStepEnter", function (event) {
event.target.classList.remove("future");
event.target.classList.add("present");
}, false);
document.addEventListener("impressStepLeave", function (event) {
event.target.classList.remove("present");
event.target.classList.add("past");
}, false);
// HASH CHANGE
// `#/step-id` is used instead of `#step-id` to prevent default browser