I am working on a project where I need to create a row of blocks. The goal is for the blocks to slide off the screen when one is clicked, leaving the clicked block in the first position.
For instance:
https://i.sstatic.net/IB5LI.jpg
I attempted using jQueryUI slide effects but encountered some issues. Here is a JS Fiddle showcasing the original configuration of the blocks. Perhaps adjusting their positioning could solve the problem? I also considered moving the blocks off the screen by changing their left distance, but the animation did not turn out as expected.
$('.block').on('click', function() {
$('.block').not($(this)).hide("slide", { direction: "left" }, 500, function() {
});