As a self-proclaimed Java nerd diving into the world of jQuery, I'm facing some challenges.
My goal is to create 3 interactive boxes that behave in a specific way: when clicked, one box should come forward while the other two dim and stay in the background. However, I want to implement a queue system so that if multiple boxes are clicked consecutively, they only move forward once the previous animation ends. Right now, everything seems to be happening simultaneously instead of in order.
I've tried using callbacks and deferred methods without success.
Below is the current Javascript code:
var zindex = 1;
$('.box_listener').click(function() {
$(this).css('z-index', zindex += 1);
$(this).siblings('.box_listener').fadeTo(3000, 0.5);
$(this).fadeTo(1, 1);
});
Here is the JSFiddle link for reference:
https://jsfiddle.net/asger/5yvvgoda/14/
Cheers, and any help would be greatly appreciated!