I have a function in pure JavaScript that flies out a div from the right. This could be written better, but I'm not worried about that right now.
If I manually call flyout(), it does what it's supposed to. If I call nextStep(), it does all the other stuff it's supposed to, except for calling flyout().
These functions are in the same file.
function flyout() {
window.phases.style.left = window.innerWidth - (window.phases.style.width.replace("px","").valueOf());
window.flown = true;
phasesName = document.getElementById("phasesName");
phasesBody = document.getElementById("phasesBody");
phasesName.style.display = "none";
phasesBody.style.display = "block";
}
function nextStep() {
switch (window.stepName) {
case "Step1":
stepName = "Step2";
step2();
break;
case "Step2":
stepName = "Step3";
step3();
break;
case "Step3":
stepName = "Step4";
step4();
break;
case "Step4":
stepName = "Step5";
step4();
break;
};
flyout();
}
It does everything I want it to, except for calling flyout() function.
window.stepName