I have three Cards, showing a certain monthly prizing with different prizes in each of the three cards. Clicking on a button reveals the annually prices. So I need to toggle. I did this with add and remove element. The Problem is: When clicking the toggle button, the formerly not visible text appears but under the formerly visible text (Because that is the position in the DOM). This causes a kind of “jump”.
I’ve no idea, how I can remove the element with the monthly prive from it’s position in DOM and replace it with the annual price without making the text jump. And vice versa.
I’ve prepared a Codepen for more clarity.
I’ve prepared a codepen for more clarity