My goal is to dynamically adjust the z-index property of two different divs as the user hovers over them.
The challenge lies in maintaining the z-index values even after the mouse has moved away, creating a seamless transition effect. You can view my code implementation here: https://jsfiddle.net/45wdhdjy/1/
$(".w-1").one("mouseover", function() {
$(".w-1").addClass('permahover');
});
However, I have encountered an issue where hovering over the blue div does not result in the yellow div having a higher z-index value during its hover state. I suspect that consolidating both scripts into a single if statement might solve this problem, but I'm unsure how to proceed. Can anyone provide guidance on how to achieve this?