DEV Community

Redesigning Layout / Git setup - Day 5(ish) of coding

Aida El Kouri on August 29, 2022

Back after a minute hiatus, I had some time today to really sit down and work on the friend manager app. I decided last time I want to try someth...
Collapse
 
zoppatorsk profile image
Zoppatorsk

Here is a neat trick you can use for the layering. Just base it of time, that way the last one will always be on top.

Something like below.

    function bringToFront(event) {
        let node = event.target.parentNode;
        node.style.zIndex = Math.floor(new Date().getTime() / 1000);
    }
Enter fullscreen mode Exit fullscreen mode
Collapse
 
booleanings profile image
Aida El Kouri

oh woah this is a great idea!! will try it today! thank you :D