var PMenu= { depth: 0 ,
panels_m_out: [],
root: null
};
PMenu.clear= function(){
alert('gweergwergwergwergwerg');
return
}
PMenu.mouseCk= function(ev){
var panel_depth;
const DELAY= 500;
ev.stopPropagation();
setTimeout('PMenu.clear()', DELAY);
return
}
PMenu.nextPanel= function(ev){
var div;
ev.stopPropagation();
PMenu.depth++;
PMenu.createDiv();
PMenu.panels_m_out.push(0);
return
}
PMenu.init= function(){
PMenu.root= document.getElementById('start_element');
return
}
PMenu.createDiv= function(){
var div= document.createElement('div');
div.className= 'PMlevel'+ PMenu.depth;
div.onclick= PMenu.nextPanel;
div.onmouseout= PMenu.mouseCk;
div.id= PMenu.depth;
PMenu.root.appendChild(div);
return
}
PMenu.init();
PMenu.createDiv(
а вот такие стили - никакго наследования здесь оно вредно:
.PMlevel0 { position: absolute;
height: 500px;
width: 50px;
top: 100px;
left: 0%;
z-index: 10;
background-color: red;
}
.PMlevel1 { position: absolute;
height: 400px;
width: 50px;
top: 100px;
left: 51px;
z-index: 10;
background-color: red;
}
.PMlevel2 { position: absolute;
height: 200px;
width: 50px;
top: 100px;
left: 102px;
z-index: 10;
background-color: red;
}