I am trying to make boxes overlap when someone clicks on them (like windows or mac ui), which I am doing, but I can’t think of a way to keep them in stacking position; when a window comes to front the two behind it get switched around.
The boxs are “findchat”, “login”, and “createaccount”
Here is the code I am running when a user clicks on one of these elements [initial is 10]:
function findchatbringto() {
document.getElementById('findchat').style.zIndex = '20';
document.getElementById('createaccount').style.zIndex = 'initial';
document.getElementById('login').style.zIndex = 'initial';
};
function createaccountbringto() {
document.getElementById('createaccount').style.zIndex = '20';
document.getElementById('login').style.zIndex = 'initial';
document.getElementById('findchat').style.zIndex = 'initial';
};
function loginbringto() {
document.getElementById('login').style.zIndex = '20';
document.getElementById('createaccount').style.zIndex = 'initial';
document.getElementById('findchat').style.zIndex = 'initial';
}