I have two elements in my website in the same container. One is visible (display: block), and one is hidden (display: none). On an event, I want the visible element to hide, and the hidden element to show. The problem is, when I show the hidden element after hiding the visible element, it always has a split second where it jumps from its previous stacked position on top of the visible element to the position it should be in:
Velocity(document.getElementById("originallyVisible"), { opacity: 0 }, { display: "none" }, {duration: 500});
Velocity(document.getElementById("originallyHidden"),{ opacity: 1 },{ display: "block" },{duration: 500, delay: 200000});
Note: the code is in velocity.js, but it should be equivalent to .hide() and .show() in native jQuery, according to docs. Please let me know if the issue is velocity specific.
I thought this was a conflict with the two commands being two close to eachother, so I added a delay to the second command. However, no matter how long the delay is, the issue still prevails.
Why does this happen?