My current project involves opening a row of blocks with an animation. The desired outcome is to transition from 2 blocks to 3 blocks by clicking a button. Specifically, the block that needs to be added should appear in the middle and fade in from left to right.
However, I am facing two challenges:
- The blocks are not aligned on a single line (the first block appears lower).
When I attempt to open the middle block, it opens from bottom to top instead of left to right
The code snippet I used can be found in the JSFiddle
$('.openRed').on('click', function (e) { $('.redHide').toggleClass('redShow').toggleClass('redHide');
If this explanation is unclear, please let me know!