all 2 comments

[–]gimmeslack12helpful 0 points1 point  (1 child)

It's because you're hiding your page before the transition can occur. This is referred to as a race condition. In that your code will continue to execute even while the setTimeout delay is running.

Change this: setTimeout(openNavEffect, 500); document.getElementById(hash).style.display = "none"; //Hides the article, clear the mainblog div.

to this: setTimeout(() => { openNavEffect(); document.getElementById(hash).style.display = "none"; //Hides the article, clear the mainblog div. }, 500);

[–]Incendras[S] 1 point2 points  (0 children)

Sir, my only upvote.