#parent{
position:relative;
width:100px;
height:100px;
background:#f99;
}
#children{
position: absolute;
width:100px;
height:100px;
right:-100%;
top:0;
background:#99f;
display:none;
}
var eParent = document.getElementById('parent')
var eChildren = document.getElementById('children')
eChildren.onmouseover = eParent.onmouseover = function(e){
eChildren.style.display="block"
}
eChildren.onmouseout = eParent.onmouseout = function(e){
eChildren.style.display="none"
}
是指这样吗
-------------------------------------更新
*{
margin:0;
padding:0;
}
ul{
list-style: none;
}
.item{
position:relative;
width:100px;
height:100px;
background:#f99;
border:1px solid #ccc;
cursor:pointer;
}
.item div{
position: absolute;
width:100px;
height:100px;
right:-100%;
top:0;
background:#99f;
display:none;
}